|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CustomDatum
This is an interface for encapsulating SQL Types into Java types of the user's choice. The user class can present a customized version of the SQL type. You can get and set values of the Java type as appropriate.
You can have lots of different classes implementing CustomDatum for a particular SQLType but generally each type implementing CustomDatum will be used for only a single SQLType.
The original motivation for this class is the jpub generator which examines SQL types (especially Object types) and creates "well typed" java versions. This includes Object types, Ref types and Array types.
It was also partially "inspired" by the jdbc2 SQLData interface.For use as a SQLJ type a class that implements CustomDatum will contain static fields and methods declared as
public static CustomDatumFactory getFactory() ... public static final int _SQLJ_TYPECODE = oracle.jdbc.driver.Types ....; // for STRUCT and ARRAY public static final String _SQLJ_NAME = "...." ; // for REF and ARRAY public static final String _SQLJ_BASETYPE = "...." ;
Typical use would be
Emp e = ... OraclePreparedStatement stmt = .... ; stmt.setCustom(n, e);
CustomDatumFactory
,
oracle.jdbc.driver.PreparedStatement
,
SQLData
Method Summary | |
---|---|
Datum |
toDatum(oracle.jdbc.driver.OracleConnection c)
Called by setOracleObject to extract a Datum. |
Method Detail |
---|
Datum toDatum(oracle.jdbc.driver.OracleConnection c) throws java.sql.SQLException
Most EmbedDatum's will ignore the connection, but it is occassionally needed. For example, if the class embeds CHAR's it may nees the connection to determine the database character set.
c
- The connection into which the value is being sent.
java.sql.SQLException
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |