com.ideo.sweetdev.core.util
Class TypeFormatter

java.lang.Object
  extended bycom.ideo.sweetdev.core.util.TypeFormatter

public class TypeFormatter
extends java.lang.Object

The class TypeFormatter contains utility methods to convert differents data types

 

Method Summary
static java.lang.Object getObjectFromResultSet(java.sql.ResultSet _rs, int _column, java.lang.String _expectedType)
          Retrieve a column value in a ResultSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getObjectFromResultSet

public static java.lang.Object getObjectFromResultSet(java.sql.ResultSet _rs,
                                                      int _column,
                                                      java.lang.String _expectedType)
                                               throws java.sql.SQLException
Retrieve a column value in a ResultSet. This method call the getXXX() method according to the expected type. Example, if the expected type is INTEGER, the method will call the getInt() method.

Throws:
java.sql.SQLException - this exception is thrown if the expected type does not match the column type in the ResultSet. Example : an excepted type int for a date column.
Parameters:
_rs - the ResultSet which contains the value to retrieve
_column - the index of the column which contains the value to retrieve
_expectedType - String
Returns:
Object the column value