JDBCUtil takes care of some of the more anoying JDBC tasks.
It hanles safe closing of jdbc resources, setting statement
parameters and loading query results.
author: Dain Sundstrom author: Alex Loubyansky author: Steve Coy version: $Revision: 57209 $
getByteArray(InputStream input) Read the entire input stream provided and return its content as a byte
array.
The method closes the passed in input stream!
Parameters: input - the InputStream from which a result isbeing retrieved.
getJDBCTypeName(int jdbcType) Gets the JDBC type name corresponding to the given type code.
Only used in debug log messages.
Parameters: jdbcType - the integer JDBC type code.
getLongString(ResultSet rs, int index) Get the indicated result set parameter as a character stream and return
it's entire content as a String.
Parameters: rs - the ResultSet from which a result isbeing retrieved. Parameters: index - index of the result column.
getParameter(Logger log, CallableStatement cs, int index, int jdbcType, Class destination) Used for all retrieval of parameters from CallableStatements.
Coerces the input value into the correct type for the specified
jdbcType.
Parameters: jdbcType - the jdbc type to which the value will be assigned Parameters: value - the value to coerce the corrected object
Coverts the value into a byte array.
Parameters: value - the value to convert into a byte array the byte representation of the value throws: SQLException - if a problem occures in the conversion
Coverts the input into an object.
Parameters: input - the bytes to convert the object repsentation of the input stream throws: SQLException - if a problem occures in the conversion
Coverts the input into an object.
Parameters: input - the bytes to convert the object repsentation of the input stream throws: SQLException - if a problem occures in the conversion
Read the entire input stream provided and return its content as a byte
array.
The method closes the passed in input stream!
Parameters: input - the InputStream from which a result isbeing retrieved. a byte array containing the content of the input stream
getJDBCTypeName
public static String getJDBCTypeName(int jdbcType)(Code)
Gets the JDBC type name corresponding to the given type code.
Only used in debug log messages.
Parameters: jdbcType - the integer JDBC type code. the JDBC type name. See Also:Types
Get the indicated result set parameter as a character stream and return
it's entire content as a String.
Parameters: rs - the ResultSet from which a result isbeing retrieved. Parameters: index - index of the result column. a String containing the content of the result column
Used for all retrieval of parameters from CallableStatements.
Implements tracing, and allows some tweaking of returned types.
Parameters: log - where to log to Parameters: cs - the CallableStatement from which an out parameter is being retrieved Parameters: index - index of the result column. Parameters: jdbcType - a java.sql.Types constant used to determine themost appropriate way to extract the data from rs. Parameters: destination - The class of the variable this is going into the value