Resource type mapping

In the Personalization resource wizards, the data model is not tightly bound to the resource implementation. Therefore, you can model resources and later choose to deploy those resources to a different SQL database.

You first choose a protocol from which to import a model when entering the wizard. Once in the wizard, you can extend this model by add tables and columns (See Adding, editing, or deleting tables or Adding, editing, or deleting columns). It is up to you to ensure that the tables required for the resource are correctly created before using the resource; however, the generated code does provide an init method which can be called to create the tables.

The table below describes the relationship between the java.sql.Type values that serve as the model for resources generated from the wizards, their corresponding Java object types, and (where applicable) the implementation of each of these types on supported JDBC platforms.

The following types are affected by the restrictions of double-byte languages:

Users should be aware that IBM DB2 automatically pads CHAR FOR BIT DATA types with spaces (x'20'). Therefore, although CHAR FOR BIT DATA may be used to store BINARY information, VARCHAR FOR BIT DATA (VARBINARY) is often a better match for small binary types that are used to store non-ACSII binary information.

java.sql.Types value Java type IBM DB2 Oracle Sybase SQL Informix
BIGINT java.lang.long BIGINT NUMBER (38, 0) BIGINT BIGINT INT8
BINARY byte[] CHAR FOR BIT DATA RAW BINARY IMAGE BYTE
BIT java.lang.Boolean N/A BIT BIT BIT BIT
BLOB byte[] BLOB BLOB BLOB BLOB BLOB
CHAR java.lang.String CHAR, GRAPHIC CHAR CHAR CHAR CHAR
CLOB java.lang.String CLOB, DBCLOB CLOB CLOB CLOB CLOB
DATE java.sql.Date DATE DATE DATE DATE DATE
DECIMAL java.math.BigDecimal DECIMAL NUMBER DECIMAL, MONEY, SMALLMONEY DECIMAL DECIMAL
DOUBLE java.lang.Double DOUBLE DOUBLE PRECISION DOUBLE PRECISION DOUBLE PRECISION DOUBLE PRECISION
FLOAT java.lang.Double FLOAT FLOAT FLOAT FLOAT FLOAT
INTEGER java.lang.Integer INTEGER INTEGER INT INTEGER INTEGER
JAVA_OBJECT java.lang.Object JAVA_OBJECT JAVA_OBJECT JAVA_OBJECT JAVA_OBJECT OPAQUE
LONGVARBINARY byte[] LONG VARCHAR FOR BIT DATA LONG RAW IMAGE IMAGE BYTE
LONGVARCHAR java.lang.String LONG VARCHAR, LONG VARGRAPHIC LONG TEXT TEXT TEXT
NUMERIC java.math.BigDecimal NUMERIC NUMBER NUMERIC NUMERIC NUMERIC
OTHER java.lang.Object OTHER OTHER OTHER OTHER OTHER
REAL java.lang.Float REAL REAL REAL REAL REAL
SMALLINT java.lang.Integer SMALLINT SMALLINT SMALLINT SMALLINT SMALLINT
TIME java.sql.Time TIME DATE TIME TIME DATETIME HOUR TO SECOND
TIMESTAMP java.sql.Timestamp TIMESTAMP DATE DATETIME, SMALLDATETIME DATETIME DATETIME YEAR TO FRACTION (5)
TINYINT java.lang.Bute SMALLINT

TINYINT

TINYINT

TINYINT TINYINT
VARBINARY byte[] VARCHAR FOR BIT DATA RAW VARBINARY IMAGE BYTE
VARCHAR java.lang.String VARCHAR, VARGRAPHIC VARCHAR VARCHAR VARCHAR VARCHAR


 

Back