The following is a sample Java type map class. You can model your custom type map on this class. For more information on type maps, see About Type Maps.
// Copyright (c) 2000 Oracle Corporation
/*
Java Object Type ---- JDBC Type
------------------------------------------
String ----- CHAR, VARCHAR, or LONGVARCHAR
java.math.BigDecimal ----- NUMERIC
Boolean ----- BIT
Integer ---- INTEGER
Long ---- BIGINT
Float ----- REAL
Double ----- DOUBLE
byte[] ----- BINARY, VARBINARY, or LONGVARBINARY
java.sql.Date ---- DATE
java.sql.Time ----- TIME
java.sql.Timestamp ---- TIMESTAMP
Clob ---- CLOB
Blob ---- BLOB
Array ----- ARRAY
Struct ----- STRUCT
Java class ---- JAVA_OBJECT
-------------------------------------------------
*/
/**
* The entries are formatted as follows:
*
COLUMN_TYPE - column type in the database
*
JAVA_CLASS_NAME - Java class which should store in-memory
data from the given column-type
*
JDBC_SQL_TYPE - Name of the jdbc sql type id
that the subsequent integer-entry represents.
* JDBC_SQL_TYPE_ID -
Integer value from java.sql.Types or a corresponding Types list in jdbc.
*
DISPLAY_LENGTH - Default size for various
String/Character types.
* NUMERIC_TYPE - The value is listed as true
for all numeric types
*
*/
import oracle.jbo.common.JboTypeMap;
import java.sql.*;
public class SampleJDBCTypeMapEntries extends
Object {
public SampleJDBCTypeMapEntries() {
new JboTypeMap("NUMBER" ,"java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
new JboTypeMap("INTEGER" ,"java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
new JboTypeMap("DATE" ,"java.sql.Date","DATE",java.sql.Types.DATE,null);
new JboTypeMap("VARCHAR2" ,"java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
}
}