|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derbyTesting.functionTests.util.BigDecimalHandler
public class BigDecimalHandler
BigDecimalHandler provides wrappers for JDBC API methods which use BigDecimal. When writing tests which use BigDecimal, the methods in this class can be called instead of directly calling JDBC methods. This way the same test can be used in JVMs like J2ME/CDC/Foundation Profile 1.0, which do not have BigDecimal class, or JSR169 Profile, which does not support method calls using BigDecimal (such as ResultSet.getBigDecimal(..).
| Field Summary | |
|---|---|
private static int[] |
bdConvertibleTypes
|
static int |
BIGDECIMAL_REPRESENTATION
|
static int |
representation
|
static int |
STRING_REPRESENTATION
|
| Constructor Summary | |
|---|---|
BigDecimalHandler()
|
|
| Method Summary | |
|---|---|
protected static boolean |
canConvertToDecimal(int type)
This method checks that the SQL type can be converted to Decimal |
static java.lang.String |
getBigDecimalString(java.sql.CallableStatement cs,
int parameterIndex,
int parameterType)
This method is a wrapper for the CallableStatement method getBigDecimal(int parameterIndex). |
static java.lang.String |
getBigDecimalString(java.sql.ResultSet rs,
int columnIndex)
This method is a wrapper for the ResultSet method getBigDecimal(int columnIndex). |
static java.lang.String |
getBigDecimalString(java.sql.ResultSet rs,
java.lang.String columnName,
int columnIndex)
This method is a wrapper for ResultSet method getBigDecimal(String columnName). |
static java.lang.String |
getObjectString(java.sql.ResultSet rs,
int columnIndex)
This method is a wrapper for ResultSet method getObject(int columnIndex) |
static java.lang.String |
getObjectString(java.sql.ResultSet rs,
java.lang.String columnName,
int columnIndex)
This method is a wrapper for ResultSet method getObject(String columnName) |
static void |
setBigDecimalString(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.String bdString)
This method is a wrapper for the PreparedStatement method setBigDecimal(int parameterIndex,BigDecimal x) |
static void |
setObjectString(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.String objectString)
This method is a wrapper for the PreparedStatement method setObject(int parameterIndex, Object x) |
static void |
updateBigDecimalString(java.sql.ResultSet rs,
int columnIndex,
java.lang.String bdString)
This method is a wrapper for ResultSet method updateBigDecimal(int columnIndex, BigDecimal x) |
static void |
updateBigDecimalString(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.String bdString)
This method is a wrapper for ResultSet method updateBigDecimal(String columnName, BigDecimal x) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int representation
public static final int STRING_REPRESENTATION
public static final int BIGDECIMAL_REPRESENTATION
private static final int[] bdConvertibleTypes
| Constructor Detail |
|---|
public BigDecimalHandler()
| Method Detail |
|---|
public static java.lang.String getBigDecimalString(java.sql.ResultSet rs,
int columnIndex)
throws java.sql.SQLException
rs - ResultSetcolumnIndex - Column Index
java.sql.SQLException
public static java.lang.String getBigDecimalString(java.sql.ResultSet rs,
java.lang.String columnName,
int columnIndex)
throws java.sql.SQLException
rs - ResultSetcolumnName - Column NamecolumnIndex - Coulumn Index
java.sql.SQLException
public static java.lang.String getObjectString(java.sql.ResultSet rs,
int columnIndex)
throws java.sql.SQLException
rs - ResultSetcolumnIndex - ColumnIndex
java.sql.SQLException
public static java.lang.String getObjectString(java.sql.ResultSet rs,
java.lang.String columnName,
int columnIndex)
throws java.sql.SQLException
rs - ResultSetcolumnName - Column NamecolumnIndex - Column Index
java.sql.SQLException
public static void updateBigDecimalString(java.sql.ResultSet rs,
int columnIndex,
java.lang.String bdString)
throws java.sql.SQLException
rs - ResultSetcolumnIndex - Column IndexbdString - String to be used in updateXXX method
java.sql.SQLException
public static void updateBigDecimalString(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.String bdString)
throws java.sql.SQLException
rs - ResultSetcolumnName - Column NamebdString - String to be used in updateXXX method
java.sql.SQLException
public static java.lang.String getBigDecimalString(java.sql.CallableStatement cs,
int parameterIndex,
int parameterType)
throws java.sql.SQLException
cs - CallableStatementparameterIndex - Parameter IndexparameterType - Parameter Type
java.sql.SQLException
public static void setBigDecimalString(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.String bdString)
throws java.sql.SQLException
ps - PreparedStatementparameterIndex - Parameter IndexbdString - String to be used in setXXX method
java.sql.SQLException
public static void setObjectString(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.String objectString)
throws java.sql.SQLException
ps - PreparedStatementparameterIndex - Parameter IndexobjectString - String to be used in setObject method
java.sql.SQLException
protected static boolean canConvertToDecimal(int type)
throws java.sql.SQLException
type - the type to check
java.sql.SQLException
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||