Enum OracleType
- java.lang.Object
-
- java.lang.Enum<OracleType>
-
- oracle.jdbc.OracleType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<OracleType>,java.sql.SQLType
public enum OracleType extends java.lang.Enum<OracleType> implements java.sql.SQLType
An enumeration of types documented in Oracle Database SQL Language Reference 21c Release 1. The JDBC driver does not necessarily support every type.- Since:
- 12.1
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()java.lang.StringgetVendor()java.lang.IntegergetVendorTypeNumber()booleanisNationalCharacterSet()Does this type use the national character set?booleanisSupported()Does this driver support this database type?static OracleTypetoOracleType(int oracleTypesConst)Returns the OracleType corresponding to the int constant defined inOracleTypes.static OracleTypetoOracleType(java.sql.SQLType sqlType)Returns the OracleType corresponding to SQLType.static OracleTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static OracleType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VARCHAR2
public static final OracleType VARCHAR2
-
NVARCHAR
public static final OracleType NVARCHAR
-
NUMBER
public static final OracleType NUMBER
-
FLOAT
public static final OracleType FLOAT
-
LONG
public static final OracleType LONG
-
DATE
public static final OracleType DATE
-
BINARY_FLOAT
public static final OracleType BINARY_FLOAT
-
BINARY_DOUBLE
public static final OracleType BINARY_DOUBLE
-
TIMESTAMP
public static final OracleType TIMESTAMP
-
TIMESTAMP_WITH_TIME_ZONE
public static final OracleType TIMESTAMP_WITH_TIME_ZONE
-
TIMESTAMP_WITH_LOCAL_TIME_ZONE
public static final OracleType TIMESTAMP_WITH_LOCAL_TIME_ZONE
-
INTERVAL_YEAR_TO_MONTH
public static final OracleType INTERVAL_YEAR_TO_MONTH
-
INTERVAL_DAY_TO_SECOND
public static final OracleType INTERVAL_DAY_TO_SECOND
-
PLSQL_BOOLEAN
public static final OracleType PLSQL_BOOLEAN
PLSQL_BOOLEAN binds BOOLEAN type for input/output parameters when executing a PLSQL function/procedure. Only available for thin driver.- Since:
- 12.2
-
RAW
public static final OracleType RAW
-
LONG_RAW
public static final OracleType LONG_RAW
-
ROWID
public static final OracleType ROWID
-
UROWID
public static final OracleType UROWID
-
CHAR
public static final OracleType CHAR
-
NCHAR
public static final OracleType NCHAR
-
CLOB
public static final OracleType CLOB
-
NCLOB
public static final OracleType NCLOB
-
BLOB
public static final OracleType BLOB
-
BFILE
public static final OracleType BFILE
-
JSON
public static final OracleType JSON
-
BOOLEAN
public static final OracleType BOOLEAN
-
UNSPECIFIED
public static final OracleType UNSPECIFIED
-
OBJECT
public static final OracleType OBJECT
-
REF
public static final OracleType REF
-
VARRAY
public static final OracleType VARRAY
-
NESTED_TABLE
public static final OracleType NESTED_TABLE
-
ANYTYPE
public static final OracleType ANYTYPE
-
ANYDATA
public static final OracleType ANYDATA
-
ANYDATASET
public static final OracleType ANYDATASET
-
XMLTYPE
public static final OracleType XMLTYPE
-
HTTPURITYPE
public static final OracleType HTTPURITYPE
-
XDBURITYPE
public static final OracleType XDBURITYPE
-
DBURITYPE
public static final OracleType DBURITYPE
-
SDO_GEOMETRY
public static final OracleType SDO_GEOMETRY
-
SDO_TOPO_GEOMETRY
public static final OracleType SDO_TOPO_GEOMETRY
-
SDO_GEORASTER
public static final OracleType SDO_GEORASTER
-
ORDAUDIO
public static final OracleType ORDAUDIO
-
ORDDICOM
public static final OracleType ORDDICOM
-
ORDDOC
public static final OracleType ORDDOC
-
ORDIMAGE
public static final OracleType ORDIMAGE
-
ORDVIDEO
public static final OracleType ORDVIDEO
-
SI_AVERAGE_COLOR
public static final OracleType SI_AVERAGE_COLOR
-
SI_COLOR
public static final OracleType SI_COLOR
-
SI_COLOR_HISTOGRAM
public static final OracleType SI_COLOR_HISTOGRAM
-
SI_FEATURE_LIST
public static final OracleType SI_FEATURE_LIST
-
SI_POSITIONAL_COLOR
public static final OracleType SI_POSITIONAL_COLOR
-
SI_STILL_IMAGE
public static final OracleType SI_STILL_IMAGE
-
SI_TEXTURE
public static final OracleType SI_TEXTURE
-
VECTOR
public static final OracleType VECTOR
A VECTOR that may contain 32-bit floating point numbers, 64-bit floating point numbers, or signed 8-bit integers. This type represents a VECTOR declared with
*as its dimension type, as inVECTOR(100, *).The int constant corresponding to this
SQLTypeisOracleTypes.VECTOR.Java to SQL Conversions
Instances of the following classes may be passed to the
setObjectmethods ofPreparedStatementandCallableStatementif the target SQL type is specified asOracleType.VECTORorOracleTypes.VECTOR:-
double[] -
float[] -
byte[]
A
double[]is converted to a VECTOR of FLOAT64 values, afloat[]is converted to a VECTOR of FLOAT32 values, and abyte[]is converted to a VECTOR of INT8 values. No information is lost when applying these conversions.SQL to Java Conversions
Any of the following classes may be passed to the
getObjectmethods ofResultSetandCallableStatementwhenOracleTypes.VECTORis returned byResultSetMetaData.getColumnType(int)orParameterMetaData.getParameterType(int):-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[] -
String -
java.sql.Clob
The preferred array class for SQL to Java conversions is
double[], as adoublecan store the information of any VECTOR value without losing information.Conversions to
float[],long[],int[],short[], andbyte[]may lose information as a narrowing conversion is applied FLOAT64 values, as if converting adoubleto the component type of the array class.Conversions to
long[],int[],short[], andbyte[]may lose information as a narrowing conversion is applied FLOAT32 values, as if converting afloatto the component type of the array class.Conversions to
boolean[]map a value of zero tofalseand all other values totrue.Conversions to
Stringreturn the VARCHAR literal expression of the VECTOR, which is each value separated by a comma and enclosed in square brackets:[value0,value1,...].Conversions to
Clobreturn an instance ofClobwhich reads the same VARCHAR literal expression that would result from a conversion toString. The returnedClobis read-only.- Since:
- 23.4
-
-
VECTOR_INT8
public static final OracleType VECTOR_INT8
A VECTOR that contains signed 8-bit integers. This type represents a VECTOR declared with
INT8as its dimension type, as inVECTOR(100, INT8).The int constant corresponding to this
SQLTypeisOracleTypes.VECTOR_INT8.The preferred array class for all conversions is
byte[], as abytecan store any INT8 value in the least number of bits without losing information.Java to SQL Conversions
Instances of the following classes may be passed to the
setObjectmethods ofPreparedStatementandCallableStatementif the target SQL type is specified asOracleType.VECTOR_INT8orOracleTypes.VECTOR_INT8:-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[]
Conversions of
double[],float[],long[],int[], andshort[]may lose information as a narrowing conversion is applied each value of the array, as if converting the component type of the array tobyte.Conversions of
byte[]do not lose information.Conversions of
boolean[]map a value oftrueto 1 and a value offalseto 0.SQL to Java Conversions
Any of the following classes may be passed to the
getObjectmethods ofResultSetandCallableStatementwhenOracleTypes.VECTOR_INT8is returned byResultSetMetaData.getColumnType(int)orParameterMetaData.getParameterType(int):-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[] -
String -
java.sql.Clob
Conversions to
double[],float[],long[],int[],short[], andbyte[]do not lose information.Conversions to
boolean[]map a value of zero tofalse, and all other values totrue.Conversions to
Stringreturn the VARCHAR literal expression of the VECTOR, which is each value separated by a comma and enclosed in square brackets:[value0,value1,...].Conversions to
Clobreturn an instance ofClobwhich reads the same VARCHAR literal expression that would result from a conversion toString. The returnedClobis read-only.- Since:
- 23.4
-
-
VECTOR_FLOAT32
public static final OracleType VECTOR_FLOAT32
A VECTOR that contains 32-bit floating point numbers. This type represents a VECTOR declared with
FLOAT32as its dimension type, as inVECTOR(100, FLOAT32).The int constant corresponding to this
SQLTypeisOracleTypes.VECTOR_FLOAT32.The preferred array class for all conversions is
float[], as afloatcan store any FLOAT32 value in the least number of bits without losing information.Java to SQL Conversions
Instances of the following classes may be passed to the
setObjectmethods ofPreparedStatementandCallableStatementif the target SQL type is specified asOracleType.VECTOR_FLOAT32orOracleTypes.VECTOR_FLOAT32:-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[]
Conversions of
double[]may lose information as a narrowing conversion is applied each value of the array, as if convertingdoubletofloat.Conversions of
long[]andint[]may lose information as a widening conversion is applied each value of the array, as if converting the component type of the array tofloat.Conversions of
float[],short[], andbyte[]do not lose information.Conversions of
boolean[]map a value oftrueto 1 and a value offalseto 0.SQL to Java Conversions
Any of the following classes may be passed to the
getObjectmethods ofResultSetandCallableStatementwhenOracleTypes.VECTOR_FLOAT32is returned byResultSetMetaData.getColumnType(int)orParameterMetaData.getParameterType(int):-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[] -
String -
java.sql.Clob
Conversions to
long[],int[],short[], andbyte[]may lose information as a narrowing conversion is applied to FLOAT32 values, as if convertingfloatto the component type of the array.Conversions to
double[]andfloat[]do not lose information.Conversions to
boolean[]map a value of zero tofalse, and all other values totrue.Conversions to
Stringreturn the VARCHAR literal expression of the VECTOR, which is each value separated by a comma and enclosed in square brackets:[value0,value1,...].Conversions to
Clobreturn an instance ofClobwhich reads the same VARCHAR literal expression that would result from a conversion toString. The returnedClobis read-only.- Since:
- 23.4
-
-
VECTOR_FLOAT64
public static final OracleType VECTOR_FLOAT64
A VECTOR that contains 64-bit floating point numbers. This type represents a VECTOR declared with
FLOAT64as its dimension type, as inVECTOR(100, FLOAT64).The int constant corresponding to this
SQLTypeisOracleTypes.VECTOR_FLOAT64.The preferred array class for all conversions is
double[], as adoublecan store any FLOAT64 value in the least number of bits without losing information.Java to SQL Conversions
Instances of the following classes may be passed to the
setObjectmethods ofPreparedStatementandCallableStatementif the target SQL type is specified asOracleType.VECTOR_FLOAT64orOracleTypes.VECTOR_FLOAT64:-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[]
Conversions of
long[]may lose information as a widening conversion is applied each value of the array, as if convertinglongtodouble.Conversions of
double[],float[],int[],short[], andbyte[]do not lose information.Conversions of
boolean[]map a value oftrueto 1 and a value offalseto 0.SQL to Java Conversions
Any of the following classes may be passed to the
getObjectmethods ofResultSetandCallableStatementwhenOracleTypes.VECTOR_FLOAT64is returned byResultSetMetaData.getColumnType(int)orParameterMetaData.getParameterType(int):-
double[] -
float[] -
long[] -
int[] -
short[] -
byte[] -
boolean[] -
String -
java.sql.Clob
Conversions to
float[],long[],int[],short[], andbyte[]may lose information as a narrowing conversion is applied to FLOAT64 values, as if convertingdoubleto the component type of the array.Conversions to
double[]do not lose information.Conversions to
boolean[]map a value of zero tofalse, and all other values totrue.Conversions to
Stringreturn the VARCHAR literal expression of the VECTOR, which is each value separated by a comma and enclosed in square brackets:[value0,value1,...].Conversions to
Clobreturn an instance ofClobwhich reads the same VARCHAR literal expression that would result from a conversion toString. The returnedClobis read-only.- Since:
- 23.4
-
-
-
Method Detail
-
values
public static OracleType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OracleType c : OracleType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OracleType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toOracleType
public static OracleType toOracleType(java.sql.SQLType sqlType) throws java.sql.SQLException
Returns the OracleType corresponding to SQLType. If the providedsqlTypeis an instance ofOracleType, this method returns thesqlTypeobject. If the providedsqlTypeis an instance ofJDBCTypehaving a vendor type number equal to the vendor type number of anOracleType, this method returns that correspondingOracleType. Otherwise, if no correspondingOracleTypeexists for thesqlType, this method throws aSQLException.- Parameters:
sqlType- A SQLType. Not null.- Returns:
- corresponding OracleType
- Throws:
java.sql.SQLException- If no OracleType corresponds tosqlType- Since:
- 12.2
-
toOracleType
public static OracleType toOracleType(int oracleTypesConst) throws java.sql.SQLException
Returns the OracleType corresponding to the int constant defined inOracleTypes.- Parameters:
oracleTypesConst- an int value defined inOracleTypes.- Returns:
- the corresponding OracleType. Not null.
- Throws:
java.sql.SQLException- if there is no corresponding OracleType.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfacejava.sql.SQLType
-
getVendor
public java.lang.String getVendor()
- Specified by:
getVendorin interfacejava.sql.SQLType
-
getVendorTypeNumber
public java.lang.Integer getVendorTypeNumber()
- Specified by:
getVendorTypeNumberin interfacejava.sql.SQLType
-
isNationalCharacterSet
public boolean isNationalCharacterSet()
Does this type use the national character set?- Returns:
- true iff this type uses the national character set
- Since:
- 12.2
-
isSupported
public boolean isSupported()
Does this driver support this database type?- Returns:
- true iff this driver supports this database type
- Since:
- 12.2
-
-