public int getJdbcType ( String ojbType ) throws SQLException { int result ; if ( ojbType == null ) ojbType = "" ; ojbType = ojbType . toLowerCase ( ) ; if ( ojbType . equals ( "bit" ) ) result = Types . BIT ; else if ( ojbType . equals ( "tinyint" ) ) result = Types . TINYINT ; else if ( ojbType . equals ( "smallint" ) ) result = Types . SMALLINT ; else if ( ojbType . equals ( "integer" ) ) result = Types . INTEGER ; else if ( ojbType . equals ( "bigint" ) ) result = Types . BIGINT ; else if ( ojbType . equals ( "float" ) ) result = Types . FLOAT ; else if ( ojbType . equals ( "real" ) ) result = Types . REAL ; else if ( ojbType . equals ( "double" ) ) result = Types . DOUBLE ; else if ( ojbType . equals ( "numeric" ) ) result = Types . NUMERIC ; else if ( ojbType . equals ( "decimal" ) ) result = Types . DECIMAL ; else if ( ojbType . equals ( "char" ) ) result = Types . CHAR ; else if ( ojbType . equals ( "varchar" ) ) result = Types . VARCHAR ; else if ( ojbType . equals ( "longvarchar" ) ) result = Types . LONGVARCHAR ; else if ( ojbType . equals ( "date" ) ) result = Types . DATE ; else if ( ojbType . equals ( "time" ) ) result = Types . TIME ; else if ( ojbType . equals ( "timestamp" ) ) result = Types . TIMESTAMP ; else if ( ojbType . equals ( "binary" ) ) result = Types . BINARY ; else if ( ojbType . equals ( "varbinary" ) ) result = Types . VARBINARY ; else if ( ojbType . equals ( "longvarbinary" ) ) result = Types . LONGVARBINARY ; else if ( ojbType . equals ( "clob" ) ) result = Types . CLOB ; else if ( ojbType . equals ( "blob" ) ) result = Types . BLOB ; else throw new SQLException ( "The type '" + ojbType + "' is not a valid jdbc type." ) ; return result ; }
Determines the java . sql . Types constant value from an OJB FIELDDESCRIPTOR value .