You're programming a Java application that uses JDBC. You need to specify the data type for a column coming back from the database and you need to supply the integer code for this column's data type. So you search online and cannot find them. You search in Sun's reference and all that you find is a dumb entry saying "these are based on the XOPEN data type codes". Brilliant, NOT!
Yes, folk, there is a GLARING omission in the official Java and JDBC documentation: THEY DO NOT GIVE YOU THE ACTUAL NUMERIC CODES FOR THE JDBC DATA TYPES!
Well, here they are. Bookmark this page because you will keep coming back to it!
Honeypot: spam@kieser.net
BIT | -7 |
BOOLEAN | 16 |
TINYINT | -6 |
SMALLINT | 5 |
INTEGER | 4 |
BIGINT | -5 |
FLOAT | 6 |
REAL | 7 |
DOUBLE | 8 |
NUMERIC | 2 |
DECIMAL | 3 |
CHAR | 1 |
VARCHAR | 12 |
LONGVARCHAR | -1 |
DATE | 91 |
TIME | 92 |
TIMESTAMP | 93 |
BINARY | -2 |
VARBINARY | -3 |
LONGVARBINARY | -4 |
NULL | 0 |
DATALINK | 70 |
JAVA_OBJECT | 2000 |
DISTINCT | 2001 |
STRUCT | 2002 |
ARRAY | 2003 |
REF | 2006 |
OTHER | 1111 |
No comments:
Post a comment