A.5. Oracle Extension Class Mappings

Most of the Oracle extensions are alternatives to the JDBC types. The oracle.sql.NUMBER type is particularly useful when storing and retrieving NUMBER columns because there is no loss of precision, as may occur when using the JDBC numeric types. The oracle.sql.ROWID type allows you to store an Oracle rowid value (rowids were discussed in Chapter 2); Oracle stores a unique address for every row in the database using a column named ROWID of type ROWID. The oracle.sql.NUMBER and oracle.sql.ROWID types were covered in Chapter 3. The oracle.sql.BLOB, oracle.sql.CLOB, and oracle.sql.BFILE types, covered in Chapter 7, allow you to access the Oracle methods for large objects. Table A-5 lists the mappings between the Oracle extension classes and the compatible Oracle types.

Table A-5. Oracle extension class mappings
Java type Oracle type
oracle.sql.NUMBER NUMBER
oracle.sql.CHAR CHAR
oracle.sql.RAW RAW
oracle.sql.DATE DATE
oracle.sql.ROWID ROWID
oracle.sql.BLOB BLOB
oracle.sql.CLOB CLOB
oracle.sql.BFILE BFILE
oracle.sql.STRUCT STRUCT
oracle.sql.REF REF
oracle.sql.ARRAY ARRAY

Get Java Programming with Oracle SQLJ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.