JDBCType (Java SE 13 & JDK 13 )
- All Implemented Interfaces:
Serializable,Comparable<JDBCType>,Constable,SQLType
public enum JDBCType extends Enum<JDBCType> implements SQLType
Defines the constants that are used to identify generic SQL types, called JDBC types.
- Since:
- 1.8
- See Also:
SQLType
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description ARRAYIdentifies the generic SQL type
ARRAY.BIGINTIdentifies the generic SQL type
BIGINT.BINARYIdentifies the generic SQL type
BINARY.BITIdentifies the generic SQL type
BIT.BLOBIdentifies the generic SQL type
BLOB.BOOLEANIdentifies the generic SQL type
BOOLEAN.CHARIdentifies the generic SQL type
CHAR.CLOBIdentifies the generic SQL type
CLOB.DATALINKIdentifies the generic SQL type
DATALINK.DATEIdentifies the generic SQL type
DATE.DECIMALIdentifies the generic SQL type
DECIMAL.DISTINCTIdentifies the generic SQL type
DISTINCT.DOUBLEIdentifies the generic SQL type
DOUBLE.FLOATIdentifies the generic SQL type
FLOAT.INTEGERIdentifies the generic SQL type
INTEGER.JAVA_OBJECTIndicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
LONGNVARCHARIdentifies the generic SQL type
LONGNVARCHAR.LONGVARBINARYIdentifies the generic SQL type
LONGVARBINARY.LONGVARCHARIdentifies the generic SQL type
LONGVARCHAR.NCHARIdentifies the generic SQL type
NCHAR.NCLOBIdentifies the generic SQL type
NCLOB.NULLIdentifies the generic SQL value
NULL.NUMERICIdentifies the generic SQL type
NUMERIC.NVARCHARIdentifies the generic SQL type
NVARCHAR.OTHERIndicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
REALIdentifies the generic SQL type
REAL.REFIdentifies the generic SQL type
REF.REF_CURSORIdentifies the generic SQL type
REF_CURSOR.ROWIDIdentifies the SQL type
ROWID.SMALLINTIdentifies the generic SQL type
SMALLINT.SQLXMLIdentifies the generic SQL type
SQLXML.STRUCTIdentifies the generic SQL type
STRUCT.TIMEIdentifies the generic SQL type
TIME.TIME_WITH_TIMEZONEIdentifies the generic SQL type
TIME_WITH_TIMEZONE.TIMESTAMPIdentifies the generic SQL type
TIMESTAMP.TIMESTAMP_WITH_TIMEZONEIdentifies the generic SQL type
TIMESTAMP_WITH_TIMEZONE.TINYINTIdentifies the generic SQL type
TINYINT.VARBINARYIdentifies the generic SQL type
VARBINARY.VARCHARIdentifies the generic SQL type
VARCHAR. -
Method Summary
Modifier and Type Method Description StringgetName()Returns the
SQLTypename that represents a SQL data type.StringgetVendor()Returns the name of the vendor that supports this data type.
IntegergetVendorTypeNumber()Returns the vendor specific type number for the data type.
static JDBCTypevalueOf(int type)Returns the
JDBCTypethat corresponds to the specifiedTypesvaluestatic JDBCTypevalueOf(String name)Returns the enum constant of this type with the specified name.
static JDBCType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BIT
Identifies the generic SQL type
BIT. -
TINYINT
public static final JDBCType TINYINT
Identifies the generic SQL type
TINYINT. -
SMALLINT
public static final JDBCType SMALLINT
Identifies the generic SQL type
SMALLINT. -
INTEGER
public static final JDBCType INTEGER
Identifies the generic SQL type
INTEGER. -
BIGINT
public static final JDBCType BIGINT
Identifies the generic SQL type
BIGINT. -
FLOAT
public static final JDBCType FLOAT
Identifies the generic SQL type
FLOAT. -
REAL
public static final JDBCType REAL
Identifies the generic SQL type
REAL. -
DOUBLE
public static final JDBCType DOUBLE
Identifies the generic SQL type
DOUBLE. -
NUMERIC
public static final JDBCType NUMERIC
Identifies the generic SQL type
NUMERIC. -
DECIMAL
public static final JDBCType DECIMAL
Identifies the generic SQL type
DECIMAL. -
CHAR
public static final JDBCType CHAR
Identifies the generic SQL type
CHAR. -
VARCHAR
public static final JDBCType VARCHAR
Identifies the generic SQL type
VARCHAR. -
LONGVARCHAR
public static final JDBCType LONGVARCHAR
Identifies the generic SQL type
LONGVARCHAR. -
DATE
public static final JDBCType DATE
Identifies the generic SQL type
DATE. -
TIME
public static final JDBCType TIME
Identifies the generic SQL type
TIME. -
TIMESTAMP
public static final JDBCType TIMESTAMP
Identifies the generic SQL type
TIMESTAMP. -
BINARY
public static final JDBCType BINARY
Identifies the generic SQL type
BINARY. -
VARBINARY
public static final JDBCType VARBINARY
Identifies the generic SQL type
VARBINARY. -
LONGVARBINARY
public static final JDBCType LONGVARBINARY
Identifies the generic SQL type
LONGVARBINARY. -
NULL
public static final JDBCType NULL
Identifies the generic SQL value
NULL. -
OTHER
public static final JDBCType OTHER
Indicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
-
JAVA_OBJECT
public static final JDBCType JAVA_OBJECT
Indicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
-
DISTINCT
public static final JDBCType DISTINCT
Identifies the generic SQL type
DISTINCT. -
STRUCT
public static final JDBCType STRUCT
Identifies the generic SQL type
STRUCT. -
ARRAY
public static final JDBCType ARRAY
Identifies the generic SQL type
ARRAY. -
BLOB
public static final JDBCType BLOB
Identifies the generic SQL type
BLOB. -
CLOB
public static final JDBCType CLOB
Identifies the generic SQL type
CLOB. -
REF
Identifies the generic SQL type
REF. -
DATALINK
public static final JDBCType DATALINK
Identifies the generic SQL type
DATALINK. -
BOOLEAN
public static final JDBCType BOOLEAN
Identifies the generic SQL type
BOOLEAN. -
ROWID
public static final JDBCType ROWID
Identifies the SQL type
ROWID. -
NCHAR
public static final JDBCType NCHAR
Identifies the generic SQL type
NCHAR. -
NVARCHAR
public static final JDBCType NVARCHAR
Identifies the generic SQL type
NVARCHAR. -
LONGNVARCHAR
public static final JDBCType LONGNVARCHAR
Identifies the generic SQL type
LONGNVARCHAR. -
NCLOB
public static final JDBCType NCLOB
Identifies the generic SQL type
NCLOB. -
SQLXML
public static final JDBCType SQLXML
Identifies the generic SQL type
SQLXML. -
REF_CURSOR
public static final JDBCType REF_CURSOR
Identifies the generic SQL type
REF_CURSOR. -
TIME_WITH_TIMEZONE
public static final JDBCType TIME_WITH_TIMEZONE
Identifies the generic SQL type
TIME_WITH_TIMEZONE. -
TIMESTAMP_WITH_TIMEZONE
public static final JDBCType TIMESTAMP_WITH_TIMEZONE
Identifies the generic SQL type
TIMESTAMP_WITH_TIMEZONE.
-
-
Method Details
-
values
public static JDBCType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
Returns the
SQLTypename that represents a SQL data type. -
getVendor
public String getVendor()
Returns the name of the vendor that supports this data type.
-
getVendorTypeNumber
public Integer getVendorTypeNumber()
Returns the vendor specific type number for the data type.
- Specified by:
getVendorTypeNumberin interfaceSQLType- Returns:
- An Integer representing the data type. For
JDBCType, the value will be the same value as inTypesfor the data type.
-
valueOf
public static JDBCType valueOf(int type)
Returns the
JDBCTypethat corresponds to the specifiedTypesvalue- Parameters:
type-Typesvalue- Returns:
- The
JDBCTypeconstant - Throws:
IllegalArgumentException- if this enum type has no constant with the specifiedTypesvalue- See Also:
Types
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.