| 
Oracle10g JDBC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.jdbc.driver.SQLUtil
SQL utility class. This class consists of a collection of static utility methods.
| Field Summary | |
static java.lang.String | 
BUILD_DATE
 | 
static boolean | 
PRIVATE_TRACE
 | 
static boolean | 
TRACE
 | 
| Constructor Summary | |
SQLUtil()
 | 
|
| Method Summary | |
static boolean | 
checkDatumType(Datum datum,
               int sqlType,
               java.lang.String sqlTypeName)
Check if the Datum is compatible with the specified SQL type.  | 
static int | 
get_internal_type(int external_type)
 | 
static java.lang.Object | 
getTypeDescriptor(java.lang.String name,
                  oracle.jdbc.internal.OracleConnection conn)
Obtain the type descriptor associated with the specified type name.  | 
static boolean | 
implementsInterface(java.lang.Class clazz,
                    java.lang.Class interfaze)
Check if a class implements an interface.  | 
static byte[] | 
JavaToSQL(oracle.jdbc.internal.OracleConnection connection,
          java.lang.Object inObject,
          int sqlTypeCode,
          java.lang.String sqlTypeName)
Convert a Java object to SQL data bytes.  | 
static Datum | 
makeDatum(oracle.jdbc.internal.OracleConnection connection,
          byte[] sqlData,
          int sqlTypeCode,
          java.lang.String sqlTypeName,
          int maxLen)
Create a Datum object from the input SQL data.  | 
static Datum | 
makeDatum(oracle.jdbc.internal.OracleConnection connection,
          java.lang.Object inObject,
          int sqlTypeCode,
          java.lang.String sqlTypeName)
Create a Datum object from an input Java object.  | 
static Datum | 
makeNDatum(oracle.jdbc.internal.OracleConnection connection,
           byte[] sqlData,
           int sqlTypeCode,
           java.lang.String sqlTypeName,
           short form,
           int maxLen)
 | 
static Datum | 
makeOracleDatum(oracle.jdbc.internal.OracleConnection connection,
                java.lang.Object inObject,
                int typeCode,
                java.lang.String sqlTypeName)
Create a Datum object from an input Java object.  | 
static java.lang.Object | 
SQLToJava(oracle.jdbc.internal.OracleConnection connection,
          byte[] sqlData,
          int sqlTypeCode,
          java.lang.String sqlTypeName,
          java.lang.Class javaClass,
          java.util.Map map)
Convert SQL data bytes to a Java object.  | 
static CustomDatum | 
SQLToJava(oracle.jdbc.internal.OracleConnection connection,
          byte[] sqlData,
          int sqlTypeCode,
          java.lang.String sqlTypeName,
          CustomDatumFactory factory)
Convert SQL data bytes to a CustomDatum object.  | 
static ORAData | 
SQLToJava(oracle.jdbc.internal.OracleConnection connection,
          byte[] sqlData,
          int sqlTypeCode,
          java.lang.String sqlTypeName,
          ORADataFactory factory)
Convert SQL data bytes to a ORAData object.  | 
static java.lang.Object | 
SQLToJava(oracle.jdbc.internal.OracleConnection connection,
          Datum datum,
          java.lang.Class javaClass,
          java.util.Map map)
Convert a Datum object to a Java object.  | 
| Methods inherited from class java.lang.Object | 
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final boolean TRACE
public static final boolean PRIVATE_TRACE
public static final java.lang.String BUILD_DATE
| Constructor Detail | 
public SQLUtil()
| Method Detail | 
public static java.lang.Object SQLToJava(oracle.jdbc.internal.OracleConnection connection,
                                         byte[] sqlData,
                                         int sqlTypeCode,
                                         java.lang.String sqlTypeName,
                                         java.lang.Class javaClass,
                                         java.util.Map map)
                                  throws java.sql.SQLException
connection - specifies the associated connection.sqlData - specifies the input SQL data.sqlTypeCode - specifies the type information of the input sqlData.
                   Use type code defined in oracle.jdbc.driver.Accessor.sqlTypeName - specifies the fully-qualified type name of the SQL data
                   if sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.javaClass - specifies the Java class to which sqlData is converted.
                   CustomDatum is not supported.  Use 'null' if the
                   default mapping is desired.map - specifies any type map to be used for a named-type.
                   This argument is ignored if sqlTypeCode is not
                   Accessor.NAMED_TYPE.  Use 'null' if the type map
                   association with the specified connection is desired.
java.sql.SQLException - if the conversion is illegal, or if an error occurred.
public static CustomDatum SQLToJava(oracle.jdbc.internal.OracleConnection connection,
                                    byte[] sqlData,
                                    int sqlTypeCode,
                                    java.lang.String sqlTypeName,
                                    CustomDatumFactory factory)
                             throws java.sql.SQLException
connection - specifies the associated connection.sqlData - specifies the input SQL data.sqlTypeCode - specifies the type information of the input sqlData.
                   Use type code defined in oracle.jdbc.driver.Accessor.sqlTypeName - specifies the fully-qualified type name of the SQL data
                   if sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.factory - specifies the factory to create the CustomDatum.
java.sql.SQLException - if the conversion is illegal, or if an error occurred.
public static ORAData SQLToJava(oracle.jdbc.internal.OracleConnection connection,
                                byte[] sqlData,
                                int sqlTypeCode,
                                java.lang.String sqlTypeName,
                                ORADataFactory factory)
                         throws java.sql.SQLException
connection - specifies the associated connection.sqlData - specifies the input SQL data.sqlTypeCode - specifies the type information of the input sqlData.
                   Use type code defined in oracle.jdbc.driver.Accessor.sqlTypeName - specifies the fully-qualified type name of the SQL data
                   if sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.factory - specifies the factory.
java.sql.SQLException - if the conversion is illegal, or if an error occurred.
public static java.lang.Object SQLToJava(oracle.jdbc.internal.OracleConnection connection,
                                         Datum datum,
                                         java.lang.Class javaClass,
                                         java.util.Map map)
                                  throws java.sql.SQLException
connection - specifies the associated connection.datum - specifies the input Datum object.javaClass - specifies the Java class to which datum is converted.
                   CustomDatum is not supported.  Use 'null' if the
                   default mapping is desired.map - specifies any type map to be used for a STRUCT datum.
                   This argument is ignored if 'datum' is not a STRUCT.
                   Use 'null' if the type map association with the
                   specified connection is desired.
java.sql.SQLException - if the conversion is illegal, or if an error occurred.
public static byte[] JavaToSQL(oracle.jdbc.internal.OracleConnection connection,
                               java.lang.Object inObject,
                               int sqlTypeCode,
                               java.lang.String sqlTypeName)
                        throws java.sql.SQLException
connection - specifies the associated connection.inObject - specifies the input Java object.sqlTypeCode - specifies the SQL type to which the input object is
                   converted.  See oracle.jdbc.driver.Accessor for the
                   appropriate type codes.sqlTypeName - specifies the fully-qualified type name if sqlTypeCode
                   is Accessor.REF_TYPE or Accessor.NAMED_TYPE.  This
                   parameter is ignored for other type codes.
java.sql.SQLException - if the conversion is illegal, or if an error occurs.
public static Datum makeDatum(oracle.jdbc.internal.OracleConnection connection,
                              byte[] sqlData,
                              int sqlTypeCode,
                              java.lang.String sqlTypeName,
                              int maxLen)
                       throws java.sql.SQLException
connection - specifies the associated connection.sqlData - specifies the input SQL data.sqlTypeCode - specifies the type information of the input sqlData.
                   Use type code defined in oracle.jdbc.driver.Accessor.sqlTypeName - specifies the fully-qualified name of the SQL data if
                   sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.maxLen - if the type is Accessor.CHAR and maxLen is non-zero, the
                   resulting Datum object (which will be a CHAR) will be
                   have a maximum length set to this value rather than
                   sqlData.length.
java.sql.SQLException - if failed to construct a Datum object from the
                   specified input.
public static Datum makeNDatum(oracle.jdbc.internal.OracleConnection connection,
                               byte[] sqlData,
                               int sqlTypeCode,
                               java.lang.String sqlTypeName,
                               short form,
                               int maxLen)
                        throws java.sql.SQLException
java.sql.SQLException
public static Datum makeDatum(oracle.jdbc.internal.OracleConnection connection,
                              java.lang.Object inObject,
                              int sqlTypeCode,
                              java.lang.String sqlTypeName)
                       throws java.sql.SQLException
connection - specifies the associated connection.inObject - specifies the input object.sqlTypeCode - specifies the type information of the input sqlData.
                   Use type code defined in oracle.jdbc.driver.Accessor.sqlTypeName - specifies the fully-qualified name of the SQL data if
                   sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.
java.sql.SQLException - if failed to construct a Datum object from the
                   specified input.
public static java.lang.Object getTypeDescriptor(java.lang.String name,
                                                 oracle.jdbc.internal.OracleConnection conn)
                                          throws java.sql.SQLException
name - specifies the type name.conn - specifies the associated connection.
java.sql.SQLException - if the specified type does not exist, or if an error
                   occurred.
public static boolean checkDatumType(Datum datum,
                                     int sqlType,
                                     java.lang.String sqlTypeName)
                              throws java.sql.SQLException
datum - specifies the Datum object to be tested.sqlTypeName - specifies the expected type name of the input datum
                   if sqlTypeCode is Accessor.REF_TYPE or Accessor.NAMED_TYPE.
                   This parameter is ignored for other type codes.
java.sql.SQLException - if errors occurred.
public static boolean implementsInterface(java.lang.Class clazz,
                                          java.lang.Class interfaze)
clazz - specifies the class to be tested.interfaze - specifies the interface.
public static Datum makeOracleDatum(oracle.jdbc.internal.OracleConnection connection,
                                    java.lang.Object inObject,
                                    int typeCode,
                                    java.lang.String sqlTypeName)
                             throws java.sql.SQLException
connection - specifies the associated connection.inObject - specifies the input object.typeCode - specifies the type information to be converted to.
                   Use type code defined in java.jdbc.driver.oracle.jdbc.internal.OracleTypes.sqlTypeName - specifies the fully-qualified name of the SQL data if
                   typeCode is oracle.jdbc.internal.OracleTypes.REF or oracle.jdbc.internal.OracleTypes.STRUCT or
                   oracle.jdbc.internal.OracleTypes.ARRAY.
                   This parameter is ignored for other type codes.
java.sql.SQLException - if failed to construct a Datum object from the
                   specified input.
public static int get_internal_type(int external_type)
                             throws java.sql.SQLException
java.sql.SQLException
  | 
Oracle10g JDBC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||