org.chur.ant.db.profiles
Class AbstractDBProfile
java.lang.Object
org.chur.ant.db.profiles.AbstractDBProfile
- All Implemented Interfaces:
- DBProfile
- Direct Known Subclasses:
- CommonProfile, DB2Profile, MySQLProfile, OracleProfile
public abstract class AbstractDBProfile
- extends java.lang.Object
- implements DBProfile
This abstract class provides the common implementation of 'convert' method from DBProfile interface.
Date: Mar 26, 2007
Time: 5:40:15 PM
Author: Sergey Churikov
Method Summary |
java.lang.String |
convert(java.sql.ResultSet rs,
int fieldIndex,
int sqlType)
Common implementation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDBProfile
protected AbstractDBProfile()
AbstractDBProfile
protected AbstractDBProfile(java.lang.String datePattern)
convert
public java.lang.String convert(java.sql.ResultSet rs,
int fieldIndex,
int sqlType)
throws java.sql.SQLException
- Common implementation. This method maps a value in the following ways:
- Types.DATE and Types.TIMESTAMP: formated with SimpleDateFormat( "dd.MM.yyyy HH:mm:ss" )
- Types.NUMERIC, Types.DECIMAL, Types.DOUBLE, Types.FLOAT and Types.REAL: formatted with DecimalFormat( "###0.#" )
- All others types have been taken as java.sql.ResultSet.getString( fieldIndex )
- Specified by:
convert
in interface DBProfile
- Parameters:
rs
- fieldIndex
- sqlType
-
- Returns:
- value of rs.getXXX( fieldIndex) which was converted into java.lang.String. Null is allowed.
- Throws:
java.sql.SQLException