Oracle8i SQLJ Developer's Guide and Reference
Release 8.1.5

A64684-01

Library

Product

Contents

Index

Prev Next

8
Reference Information

This chapter contains detailed JDBC reference information, including the following topics:

Valid SQL-JDBC Datatype Mappings

Table 3-1 and Table 3-2 in Chapter 3 describe the default mappings between Java classes and SQL datatypes that are supported by the Oracle JDBC drivers. Compare the contents of the Standard JDBC Datatypes, Java Native Datatypes and Oracle SQL Datatypes columns in Table 3-1 and Table 3-2 with the contents of Table 8-1 below.

Table 8-1 lists all of the possible Java classes to which a given SQL datatype can be validly mapped. The Oracle JDBC drivers will support these "non-default" mappings. For example, to materialize SQL CHAR data as an oracle.sql.CHAR, use getCHAR(). To materialize it as a java.math.BigDecimal, use getBigDecimal().

Table 8-1 Valid SQL Datatype-Java Class Mappings
This SQL datatype:   Can be materialized as these Java classes:  

CHAR, NCHAR,VARCHAR2,  

oracle.sql.CHAR  

NVARCHAR2, LONG  

java.lang.String  

 

java.sql.Date  

 

java.sql.Time  

 

java.sql.Timestamp  

 

java.lang.Byte  

 

java.lang.Short  

 

java.lang.Integer  

 

java.lang.Long  

 

java.lang.Float  

 

java.lang.Double  

 

java.math.BigDecimal  

 

byte, short, int, long, float, double  

DATE  

oracle.sql.DATE  

 

java.sql.Date  

 

java.sql.Time  

 

java.sql.Timestamp  

 

java.lang.String  

NUMBER  

oracle.sql.NUMBER  

 

java.lang.Byte  

 

java.lang.Short  

 

java.lang.Integer  

 

java.lang.Long  

 

java.lang.Float  

 

java.lang.Double  

 

java.math.BigDecimal  

 

byte, short, int, long, float, double  

RAW, LONG RAW  

oracle.sql.RAW  

 

byte[]  

ROWID  

oracle.sql.CHAR  

 

oracle.sql.ROWID  

 

java.lang.String  

BFILE  

oracle.sql.BFILE  

BLOB  

oracle.sql.BLOB  

 

oracle.jdbc2.Blob  

CLOB, NCLOB  

oracle.sql.CLOB  

 

oracle.jdbc2.Clob  

OBJECT  

oracle.sql.STRUCT  

 

oracle.SqljData  

 

oracle.jdbc2.Struct  

REF  

oracle.sql.REF  

 

oracle.jdbc2.Ref  

TABLE (nested), VARRAY  

oracle.sql.ARRAY  

 

oracle.jdbc2.Array  

any of the above SQL types  

oracle.sql.CustomDatum or oracle.sql.Datum  


Notes:

  • The type UROWID is not supported.

  • oracle.sql.Datum is an abstract class. The value passed to a parameter of type oracle.sql.Datum must be of the Java type corresponding to the SQL type. Likewise, the value returned by a method with return type oracle.sql.Datum must be of the Java type corresponding to the SQL type.

  • The mappings to oracle.sql classes are optimal if no conversion from SQL format to Java format is necessary.

 

Supported SQL and PL/SQL Datatypes

The tables in this section list SQL and PL/SQL datatypes, and whether the Oracle JDBC drivers and SQLJ support them. Table 8-2 describes Oracle JDBC driver and SQLJ support for SQL datatypes.

Table 8-2 Support for SQL Datatypes
SQL Datatype  Supported by JDBC Drivers?  Supported by SQLJ? 

BFILE  

yes  

yes  

BLOB  

yes  

yes  

CHAR  

yes  

yes  

CLOB  

yes  

yes  

DATE  

yes  

yes  

NCHAR  

no  

no  

NCHAR VARYING  

no  

no  

NUMBER  

yes  

yes  

NVARCHAR2  

no  

no  

RAW  

yes  

yes  

REF  

yes  

yes  

ROWID  

yes  

yes  

UROWID  

no  

no  

VARCHAR2  

yes  

yes  

Table 8-3 describes Oracle JDBC driver and SQLJ support for the ANSI-supported SQL datatypes.

Table 8-3 Support for ANSI-Supported SQL Datatypes
ANSI-Supported SQL Datatypes  Supported by JDBC Drivers?  Supported by SQLJ? 

CHARACTER  

yes  

yes  

DEC  

yes  

yes  

DECIMAL  

yes  

yes  

DOUBLE PRECISION  

yes  

yes  

FLOAT  

yes  

yes  

INT  

yes  

yes  

INTEGER  

yes  

yes  

NATIONAL CHARACTER  

no  

no  

NATIONAL CHARACTER VARYING  

no  

no  

NATIONAL CHAR  

no  

no  

NATIONAL CHAR VARYING  

no  

no  

NCHAR  

no  

no  

NCHAR VARYING  

no  

no  

NUMERIC  

yes  

yes  

REAL  

yes  

yes  

SMALLINT  

yes  

yes  

VARCHAR  

yes  

yes  

Table 8-4 describes Oracle JDBC driver and SQLJ support for PL/SQL datatypes. Note that PL/SQL datatypes include these categories:

NLS Character Set Support

On the client, the Oracle JDBC OCI and Thin drivers support all Oracle NLS character sets. On the server, the Oracle JDBC Server driver supports only two Oracle NLS character sets: US7ASCII (ASCII 7-bit American) and WE8ISO8859P1 (ISO 8859-1 West European or "ISO-Latin 1").

Related Information

This section lists web sites that contain useful information for JDBC programmers. Many of the sites are referenced in other sections of this manual. In this list you can find references to the Oracle JDBC drivers and SQLJ, Java technology, the Java Developer's Kit APIs (for versions 1.2 and 2.0), and resources to help you write applets.

Oracle JDBC Drivers and SQLJ

Oracle JDBC Driver Home Page (Oracle Corporation)

http://www.oracle.com/st/products/jdbc/

Oracle JDBC Driver Download Page (Oracle Corporation)

http://www.oracle.com/products/free_software/index.html#jdbc8

Oracle SQLJ Home Page (Oracle Corporation)

http://www.oracle.com/st/products/jdbc/sqlj/index.html

Java Technology

Java Technology Home Page (Sun Microsystems, Inc.):

http://www.javasoft.com/

Java Development Kit 1.1 (JDK1.1) (Sun Microsystems, Inc.):

http://java.sun.com/products/jdk/1.1/

Java Platform JDK1.1 Core API Specification (Sun Microsystems, Inc.):

http://www.javasoft.com/products/jdk/1.1/docs/api/packages.html

Java Development Kit 1.2 (JDK1.2) (Sun Microsystems, Inc.):

http://java.sun.com:80/products/jdk/1.2/index.html

Java Platform JDK1.2 Core API Specification (Sun Microsystems, Inc.):

http://www.javasoft.com/products/jdk/1.2/docs/api/index.html

Signed Applets

Introduction to Capabilities Classes (Netscape Communications Corp.):

http://developer.netscape.com/docs/manuals/signedobj/capabilities/contents.htm

Object-Signing Resources (Netscape Communications Corp.):

http://developer.netscape.com/software/signedobj/index.html

Signed Applet Example (Sun Microsystems, Inc.):

http://java.sun.com/security/signExample/index.html 




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index