Re: JDBC mapping of TINYINT and SMALLINT
Karsten,
What's up with that is that code generators are not following the JDBC specification, and the JDBC driver must. There's an infamous table, "B3" in the specification that says the following mapping is in effect for ResultSet.getObject():
CHAR String
VARCHAR String
LONGVARCHAR String
NUMERIC java.math.BigDecimal
DECIMAL java.math.BigDecimal
BIT Boolean
BOOLEAN Boolean
TINYINT Integer
SMALLINT Integer
INTEGER Integer
BIGINT Long
REAL Float
FLOAT Double
DOUBLE Double
BINARY byte[]
VARBINARY byte[]
LONGVARBINARY byte[]
DATE java.sql.Date
TIME java.sql.Time
TIMESTAMP java.sql.Timestamp
DISTINCT Object type of underlying type
CLOB java.sql.Clob
BLOB java.sql.Blob
ARRAY java.sql.Array
STRUCT java.sql.Struct or java.sql.SQLData
REF java.sql.Ref
DATALINK java.net.URL
JAVA_OBJECT underlying Java class
ROWID java.sql.RowId
NCHAR String
NVARCHAR String
LONGNVARCHAR String
NCLOB java.sql.NClob
SQLXML java.sql.SQLXML
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html
Subject
Written By
Posted
Re: JDBC mapping of TINYINT and SMALLINT
August 02, 2010 04:44PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.