Create the necessary tables, function and procedures for running the
CallableStatement tests under JDK 1.6.
Java methods used as functions and procedures are also implemented here,
along with helper methods that returns CallableStatements for the various
functions and procedures.
getBinaryFromDbFunction(Connection con) Return statement for calling getBinaryFromDb function.
Parameter 1: return/output - byte[]/VARCHAR FOR BINARY - data from db
Parameter 2: input - int/INT - id for row to fetch
Parameters: con - database connection.
getVarcharFromDbFunction(Connection con) Return statement for calling getVarcharFromDb function.
Parameter 1: return/output - String/VARCHAR - data from db
Parameter 2: input - int/INT - id for row to fetch
Parameters: con - database connection.
public CallableStatementTestSetup(Test test)(Code)
Create a new test setup for the CallableStatementTest.
Parameters: test - the test/suite to provide setup for.
Method Detail
getBinaryDirect
public static void getBinaryDirect(String inputString, byte[][] outputByte)(Code)
Procedure creating a byte representation of a string.
Parameters: inputString - a string. Parameters: outputByte - string returned as UTF-16BE byte representation.
Return statement for calling procedure that converts a string to a
byte array (UTF-16BE charset).
Parameter 1: input - String/VARCHAR(40)
Parameter 2: output - byte[]/VARCHAR(160) FOR BIT DATA
getBinaryFromDb
public static byte[] getBinaryFromDb(int id) throws Exception(Code)
Function fetching binary data from the database.
Parameters: id - id of row to fetch. a byte array.
Return statement for calling getBinaryFromDb function.
Parameter 1: return/output - byte[]/VARCHAR FOR BINARY - data from db
Parameter 2: input - int/INT - id for row to fetch
Parameters: con - database connection. statement for executing getBinaryFromDb function.
Return statement for calling getVarcharFromDb function.
Parameter 1: return/output - String/VARCHAR - data from db
Parameter 2: input - int/INT - id for row to fetch
Parameters: con - database connection. statement for executing getVarcharFromDb function.