net.ontopia.persistence.proxy
Class SQLTypes

java.lang.Object
  extended by net.ontopia.persistence.proxy.SQLTypes

public class SQLTypes
extends java.lang.Object

INTERNAL: Utility class for handling access to columns by proper SQL type. Note that all type integers are the same as the ones in java.sql.Types.


Field Summary
static int SIZE_THRESHOLD
           
 
Constructor Summary
SQLTypes()
           
 
Method Summary
static java.lang.Object getObject(java.sql.ResultSet rs, int index, int sql_type, boolean direct)
          INTERNAL: Reads the object of the given type at the specified index from the result set.
static int getType(java.lang.Class klass)
          INTERNAL: Gets the SQL type mapped to the given java class.
static java.lang.Class getType(int sql_type)
          INTERNAL: Gets the java class mapped to by the given SQL type.
static void setObject(java.sql.PreparedStatement stmt, int index, java.lang.Object value, int sql_type)
          INTERNAL: Binds the object of the given type at the specified index in the prepared statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_THRESHOLD

public static final int SIZE_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

SQLTypes

public SQLTypes()
Method Detail

getType

public static int getType(java.lang.Class klass)
INTERNAL: Gets the SQL type mapped to the given java class.


getType

public static java.lang.Class getType(int sql_type)
INTERNAL: Gets the java class mapped to by the given SQL type.


getObject

public static java.lang.Object getObject(java.sql.ResultSet rs,
                                         int index,
                                         int sql_type,
                                         boolean direct)
                                  throws java.sql.SQLException
INTERNAL: Reads the object of the given type at the specified index from the result set.

Throws:
java.sql.SQLException

setObject

public static void setObject(java.sql.PreparedStatement stmt,
                             int index,
                             java.lang.Object value,
                             int sql_type)
                      throws java.sql.SQLException
INTERNAL: Binds the object of the given type at the specified index in the prepared statement.

Throws:
java.sql.SQLException


Copyright © 2000-2012 Ontopia.