Wednesday, 20 January 2010

The JDBC XOPEN SQL type codes

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
BOOLEAN16
TINYINT-6
SMALLINT5
INTEGER4
BIGINT-5
FLOAT6
REAL7
DOUBLE8
NUMERIC2
DECIMAL3
CHAR1
VARCHAR12
LONGVARCHAR-1
DATE91
TIME92
TIMESTAMP93
BINARY-2
VARBINARY-3
LONGVARBINARY-4
NULL0
DATALINK70
JAVA_OBJECT2000
DISTINCT2001
STRUCT2002
ARRAY2003
REF2006
OTHER1111

1 comment:

  1. Outside support takes time and prices money, nonetheless internal maintenance crews can jump on a CNC machine breakdown, resulting in decreased downtime. As lengthy as elements are available in-house, repair times are often minimal. This efficiency is not only seen in the bottom line but additionally in on-time supply with pleased best stylus for iphone prospects. Goodwin College’s competitive CNC operator school is designed to get college students certified and working in the area in a short time period, on a versatile schedule. No matter your private obligations or present work situation, Goodwin has a producing program on your busy lifestyle. You wouldn't have to put your life on maintain to pursue the degree of your goals.

    ReplyDelete