Abstract implementation of the SqlTypeValue interface, for convenient
creation of type values that are supposed to be passed into the
PreparedStatement.setObject method. The
createTypeValuecallback method has access to the underlying Connection, if that should
be needed to create any database-specific objects.
A usage example from a StoredProcedure (compare this to the plain
SqlTypeValue version in the superclass javadoc):
proc.declareParameter(new SqlParameter("myarray", Types.ARRAY, "NUMBERS"));
...
Map<String, Object> in = new HashMap<String, Object>();
in.put("myarray", new AbstractSqlTypeValue() {
public Object createTypeValue(Connection con, int sqlType, String typeName) throws SQLException {
oracle.sql.ArrayDescriptor desc = new oracle.sql.ArrayDescriptor(typeName, con);
return new oracle.sql.ARRAY(desc, con, seats);
}
});
Map out = execute(in);