public class DBTypes
extends java.lang.Object
In general, a JDBC driver will automatically handle mapping non-standard data types to something that it (and thus this class) understands. For example, the ODBC bridge automatically converts references to the MS Access COUNTER data type to an INTEGER. However, you might want find the utility methods provided by this class useful for building administrative services or for debugging.
Constructor and Description |
---|
DBTypes() |
Modifier and Type | Method and Description |
---|---|
static int |
codeForName(java.lang.String name)
Converts a specified SQL type name into a type code.
|
static int[] |
codeList()
Lists all known JDBC SQL type codes.
|
static java.lang.String |
nameForCode(int code)
Converts a specified SQL type code into a type name.
|
static java.lang.String[] |
nameList()
Lists all known JDBC SQL type names.
|
public static int codeForName(java.lang.String name)
name
- A String specifying the name of the SQL data type (e.g. "VARCHAR") whose code
you want to obtain. (Character case is irrelevant.)public static java.lang.String nameForCode(int code)
code
- An int specifying the SQL type code (e.g. "12") whose name you want to obtain.public static java.lang.String[] nameList()
public static int[] codeList()