org.bsf.listOfValues.util
Class LovTypeManager

java.lang.Object
  extended byorg.bsf.listOfValues.util.LovTypeManager

public class LovTypeManager
extends java.lang.Object

This class contains the definition of the type used by the LovBean and the methods to handle the resultset regarding those types. Boolean are handled from 0(false) and 1 (true). The type comparaisons are case insensitive and check with Strings like "java.lang.Double" or "java.lang.String"...


Field Summary
static java.lang.String BOOLEAN_TYPE
           
static java.lang.String DATE_TYPE
           
static java.lang.String DOUBLE_TYPE
           
static java.lang.String FLOAT_TYPE
           
static java.lang.String INTEGER_TYPE
           
static java.lang.String LONG_TYPE
           
static java.lang.String SQL_DATE_TYPE
           
static java.lang.String STRING_TYPE
           
 
Constructor Summary
LovTypeManager()
           
 
Method Summary
static java.lang.Boolean getBoolean(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.util.Date getDate(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.Double getDouble(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.Float getFloat(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.Integer getInteger(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.Long getLong(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.Object getObjectOfType(java.lang.String p_type, java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.sql.Date getSqlDate(java.sql.ResultSet p_rs, int p_columnIndex)
           
static java.lang.String getString(java.sql.ResultSet p_rs, int p_columnIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_TYPE

public static final java.lang.String BOOLEAN_TYPE
See Also:
Constant Field Values

DOUBLE_TYPE

public static final java.lang.String DOUBLE_TYPE
See Also:
Constant Field Values

FLOAT_TYPE

public static final java.lang.String FLOAT_TYPE
See Also:
Constant Field Values

INTEGER_TYPE

public static final java.lang.String INTEGER_TYPE
See Also:
Constant Field Values

LONG_TYPE

public static final java.lang.String LONG_TYPE
See Also:
Constant Field Values

STRING_TYPE

public static final java.lang.String STRING_TYPE
See Also:
Constant Field Values

DATE_TYPE

public static final java.lang.String DATE_TYPE
See Also:
Constant Field Values

SQL_DATE_TYPE

public static final java.lang.String SQL_DATE_TYPE
See Also:
Constant Field Values
Constructor Detail

LovTypeManager

public LovTypeManager()
Method Detail

getInteger

public static java.lang.Integer getInteger(java.sql.ResultSet p_rs,
                                           int p_columnIndex)
                                    throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as an Integer or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getLong

public static java.lang.Long getLong(java.sql.ResultSet p_rs,
                                     int p_columnIndex)
                              throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a Long or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getString

public static java.lang.String getString(java.sql.ResultSet p_rs,
                                         int p_columnIndex)
                                  throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a String.
Throws:
java.sql.SQLException - If a database access error occurs.

getBoolean

public static java.lang.Boolean getBoolean(java.sql.ResultSet p_rs,
                                           int p_columnIndex)
                                    throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a Boolean (0 is handled as a Boolean.FALSE while 1 is handled as a Boolean.TRUE) or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getDouble

public static java.lang.Double getDouble(java.sql.ResultSet p_rs,
                                         int p_columnIndex)
                                  throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a Double or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getFloat

public static java.lang.Float getFloat(java.sql.ResultSet p_rs,
                                       int p_columnIndex)
                                throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a Float or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getDate

public static java.util.Date getDate(java.sql.ResultSet p_rs,
                                     int p_columnIndex)
                              throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a Date or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getSqlDate

public static java.sql.Date getSqlDate(java.sql.ResultSet p_rs,
                                       int p_columnIndex)
                                throws java.sql.SQLException
Parameters:
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object formatted as a SQL Date or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.

getObjectOfType

public static java.lang.Object getObjectOfType(java.lang.String p_type,
                                               java.sql.ResultSet p_rs,
                                               int p_columnIndex)
                                        throws java.sql.SQLException
Parameters:
p_type - The type to use for the returned Object (should be a String like "java.lang.Long" or "java.lang.String".
p_rs - The resultset to use as source of the needed Object.
p_columnIndex - The index of the column that we want to retrieve.
Returns:
The desired Object retrieve from the resultset as the given type or null if the Object in the resultset is null.
Throws:
java.sql.SQLException - If a database access error occurs.
java.lang.IllegalArgumentException - if the type or the resultset is null or if the type is unknown.