| java.lang.Object com.versant.core.jdbc.JdbcUtils
JdbcUtils | public class JdbcUtils implements MDStatics(Code) | | Static JDBC utility functions. These are used to implement GenericOID
and GenericState in a way similar to the generated State and OID
implementations. They are also used elsewhere in JdbcDataStore.
See Also: GenericOID See Also: GenericState |
Method Summary | |
public static Object | get(ResultSet rs, int index, int javaTypeCode, int scale) Get a value from a ResultSet. | public static String | getPreparedStatementInfo(String sql, PreparedStatement ps) Build a message with info about ps for exceptions and so on. | public static String | getPreparedStatementInfo(String sql, PreparedStatement ps, int batchEntry) Build a message with info about ps for exceptions and so on. | public static void | set(PreparedStatement ps, int index, Object value, int javaTypeCode, int jdbcType) Set a parameter on a PreparedStatement. | public static void | set(PreparedStatement ps, int index, int value, int javaTypeCode, int jdbcType) Set a parameter on a PreparedStatement. | public static Object | toArrayNoNulls(ArrayList values, int javaTypeCode) Convert an ArrayList of values into an properly typed array (int[],
String[], byte[] etc.). | public static String | toString(Throwable x) Convert x to a String by calling its toString method. |
get | public static Object get(ResultSet rs, int index, int javaTypeCode, int scale) throws SQLException(Code) | | Get a value from a ResultSet. This will call getInt or getShort etc.
|
getPreparedStatementInfo | public static String getPreparedStatementInfo(String sql, PreparedStatement ps)(Code) | | Build a message with info about ps for exceptions and so on. If the
ps contains batches of parameters they are all added to the info
String.
|
getPreparedStatementInfo | public static String getPreparedStatementInfo(String sql, PreparedStatement ps, int batchEntry)(Code) | | Build a message with info about ps for exceptions and so on. Parameter
info is provided for the given batch entry if available.
|
set | public static void set(PreparedStatement ps, int index, Object value, int javaTypeCode, int jdbcType) throws SQLException(Code) | | Set a parameter on a PreparedStatement. This will call setInt or
setShort etc depending on the type of value.
|
set | public static void set(PreparedStatement ps, int index, int value, int javaTypeCode, int jdbcType) throws SQLException(Code) | | Set a parameter on a PreparedStatement. This will call setInt or
setShort etc depending on the type of value. This method is used
when the value is available as an int to avoid creating a wrapper
instance.
|
toArrayNoNulls | public static Object toArrayNoNulls(ArrayList values, int javaTypeCode) throws SQLException(Code) | | Convert an ArrayList of values into an properly typed array (int[],
String[], byte[] etc.). Arrays of wrapper types (Integer et al) are
returned as arrays of primitives to save memory. This means that
there cannot be any nulls in values.
|
toString | public static String toString(Throwable x)(Code) | | Convert x to a String by calling its toString method. If x is an
SQLException then any getNextExceptions() are recursively added to
the string preceded by linefeeds.
|
|
|