org.apache.ojb.broker.util
Class JdbcTypesHelper

java.lang.Object
  extended byorg.apache.ojb.broker.util.JdbcTypesHelper

public final class JdbcTypesHelper
extends java.lang.Object

Helper class centralise all SQL Types operations and make available JdbcType inner class implementations.

Version:
$Id: JdbcTypesHelper.java,v 1.7 2004/02/17 16:39:34 arminw Exp $
Author:
Armin Waibel

Nested Class Summary
static class JdbcTypesHelper.BaseType
           
static class JdbcTypesHelper.T_Array
           
static class JdbcTypesHelper.T_BigInt
           
static class JdbcTypesHelper.T_Binary
           
static class JdbcTypesHelper.T_Bit
           
static class JdbcTypesHelper.T_Blob
           
static class JdbcTypesHelper.T_Boolean
           
static class JdbcTypesHelper.T_Char
           
static class JdbcTypesHelper.T_Clob
           
static class JdbcTypesHelper.T_Datalink
           
static class JdbcTypesHelper.T_Date
           
static class JdbcTypesHelper.T_Decimal
           
static class JdbcTypesHelper.T_Double
           
static class JdbcTypesHelper.T_Float
           
static class JdbcTypesHelper.T_Integer
           
static class JdbcTypesHelper.T_LongVarBinary
           
static class JdbcTypesHelper.T_LongVarChar
           
static class JdbcTypesHelper.T_Numeric
           
static class JdbcTypesHelper.T_Real
           
static class JdbcTypesHelper.T_Ref
           
static class JdbcTypesHelper.T_SmallInt
           
static class JdbcTypesHelper.T_Struct
           
static class JdbcTypesHelper.T_Time
           
static class JdbcTypesHelper.T_Timestamp
           
static class JdbcTypesHelper.T_TinyInt
           
static class JdbcTypesHelper.T_VarBinary
           
static class JdbcTypesHelper.T_Varchar
           
 
Constructor Summary
JdbcTypesHelper()
           
 
Method Summary
static java.lang.String getJdbcTypeAsString(int jdbcType)
          Returns a string representation of the given Types value.
static JdbcType getJdbcTypeByName(java.lang.String typeName)
          Lookup the JdbcType by name.
static JdbcType getJdbcTypeByReflection(java.lang.String fieldType)
          Try to automatically assign a jdbc type for the given java type name.
static JdbcType getJdbcTypeByTypesIndex(java.lang.Integer type)
          Return the JdbcType for the given jdbc type.
static java.lang.Object getObjectFromColumn(java.sql.ResultSet rs, java.lang.Integer jdbcType, int columnId)
          Returns an java object read from the specified ResultSet column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcTypesHelper

public JdbcTypesHelper()
Method Detail

getJdbcTypeByTypesIndex

public static JdbcType getJdbcTypeByTypesIndex(java.lang.Integer type)
Return the JdbcType for the given jdbc type.


getJdbcTypeByName

public static JdbcType getJdbcTypeByName(java.lang.String typeName)
Lookup the JdbcType by name. If name was not found an exception is thrown.


getJdbcTypeByReflection

public static JdbcType getJdbcTypeByReflection(java.lang.String fieldType)
Try to automatically assign a jdbc type for the given java type name. This method is used if e.g. in metadata a column type was not set.

See Also:
FieldDescriptor.getJdbcType()

getObjectFromColumn

public static java.lang.Object getObjectFromColumn(java.sql.ResultSet rs,
                                                   java.lang.Integer jdbcType,
                                                   int columnId)
                                            throws java.sql.SQLException
Returns an java object read from the specified ResultSet column.

Throws:
java.sql.SQLException

getJdbcTypeAsString

public static java.lang.String getJdbcTypeAsString(int jdbcType)
Returns a string representation of the given Types value.



Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14