/*
 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * @(#)callStmtClient20.java	1.9 02/01/12
 */

package com.sun.cts.tests.jdbc.ee.callStmt.callStmt20;

import java.io.*;
import java.util.*;
import java.math.*;

import java.sql.*;
import javax.sql.*;

import com.sun.cts.util.*;
import com.sun.cts.porting.*;
import com.sun.cts.harness.*;

import java.rmi.RemoteException;

import javasoft.sqe.javatest.Status;
import com.sun.cts.tests.jdbc.ee.common.*;


// Merant DataSource class
//import com.merant.sequelink.jdbcx.datasource.*;


/**
 * The callStmtClient20 class tests methods of CallableStatement interface (to check the
 * Support for IN, OUT and INOUT parameters of Stored Procedure) using
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.7, 06/16/99
 */

public class callStmtClient20 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt20";

	//Naming specific member variables
	private CTSNamingContextInterface jc = null;

	//Harness requirements

	private transient Connection conn = null;
	private DataSource ds1 = null;
	private csSchema csSch=null;
	private rsSchema rsSch=null;
	private	String drManager=null;
	private Properties sqlp = null;
	private	CallableStatement cstmt = null;

	/* Run test in standalone mode */
	public static void main(String[] args)
	{
		callStmtClient20 theTests = new callStmtClient20();
		Status s=theTests.run(args, System.out, System.err);
		s.exit();
	}

	/*  Test setup: */
	/*
	 *   @class.setup_props: Driver, the Driver name;
	 *			db1, the database name with url;
	 *			user1, the database user name;
	 *			password1, the database password;
	 *			db2, the database name with url;
	 *			user2, the database user name;
	 *			password2, the database password;
	 *			DriverManager, flag for DriverManager;
	 *			ptable, the primary table;
	 *			ftable, the foreign table;
	 *			cofSize, the initial size of the ptable;
	 *			cofTypeSize, the initial size of the ftable;
	 *			binarySize, size of binary data type;
	 *			varbinarySize, size of varbinary data type;
	 *			longvarbinarySize, size of longvarbinary data type;
	 *  @class.testArgs:     -ap ctssql.stmt
	 */
	public void setup(String[] args, Properties p) throws Fault
	{
		try
		{
			try
			{
				drManager = p.getProperty("DriverManager","");
				if (drManager.length() == 0)
					throw new Fault("Invalid DriverManager Name");
				sqlp=p;

				if(drManager.equals("yes"))
				{
					logMsg("Using DriverManager");
					DriverManagerConnection dmCon = new DriverManagerConnection();
					conn = dmCon.getConnection(p);
				}
				else
				{
					logMsg("Using DataSource");
					DataSourceConnection dsCon = new DataSourceConnection();
					conn = dsCon.getConnection(p);
				}
				rsSch = new rsSchema();
				csSch = new csSchema();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception : " + ex.getMessage());
			}
		}
		catch  ( Exception e )
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}


	/*
	 * @testName:         testRegisterOutParameter09
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setFloat() method to
	 *                    set maximum Real value in null column of Real table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getFloat method.  It should return a float value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter09() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

			String sMaxRealVal = rsSch.extractVal("Real_Tab",1,sqlp,conn);
			float maxRealVal = Float.parseFloat(sMaxRealVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Real_Io_Null(?)}");
			cstmt.setFloat(1,maxRealVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.REAL);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getFloat(NULL_VAL)");
			//invoke getFloat method
			float oRetVal = cstmt.getFloat(1);
			logMsg("Returned Value from ctssql.stmt:" + maxRealVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxRealVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Real_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter10
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setFloat() method to
	 *                    set minimum real value in maximum value column in Real table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getFloat method.  It should return a float value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter10() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

			String sMinRealVal = rsSch.extractVal("Real_Tab",2,sqlp,conn);
			float minRealVal=Float.parseFloat(sMinRealVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Real_Io_Max(?)}");
			cstmt.setFloat(1,minRealVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.REAL);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getFloat(MAX_VAL)");
			//invoke getFloat method
			float oRetVal = cstmt.getFloat(1);
			logMsg("Returned Value from ctssql.stmt:" + minRealVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minRealVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Real_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter11
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBoolean() method to
	 *                    set maximum BIT value in null column of BIT table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getBoolean method.  It should return a boolean value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter11() throws Fault
	{
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

			String sMaxBooleanVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);
			boolean maxBooleanVal = Boolean.getBoolean(sMaxBooleanVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_Io_Null(?)}");
			cstmt.setBoolean(1,maxBooleanVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBoolean(NULL_VAL)");
			//invoke getBoolean method
			boolean oRetVal = cstmt.getBoolean(1);
			logMsg("Returned Value from ctssql.stmt:" + maxBooleanVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxBooleanVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter12
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBoolean() method to
	 *                    set minimum BIT value in maximum value column in BIT table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getBoolen method.  It should return a boolean value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter12() throws Fault
	{
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

			String sMinBooleanVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);
			boolean minBooleanVal=Boolean.getBoolean(sMinBooleanVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_Io_Max(?)}");
			cstmt.setBoolean(1,minBooleanVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBoolean(MAX_VAL)");
			//invoke getBoolean method
			boolean oRetVal = cstmt.getBoolean(1);
			logMsg("Returned Value from ctssql.stmt:" + minBooleanVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minBooleanVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
				
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter13
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setByte() method to
	 *                    set maximum Smallint value in null column of Smallint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getByte method.  It should return a byte value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter13() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

			String sMaxByteVal = rsSch.extractVal("Smallint_Tab",1,sqlp,conn);
			short maxByteVal = Short.parseShort(sMaxByteVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Smallint_Io_Null(?)}");
			cstmt.setShort(1,maxByteVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getByte(NULL_VAL)");
			//invoke getByte method
			short oRetVal = cstmt.getShort(1);
			logMsg("Returned Value from ctssql.stmt:" + maxByteVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxByteVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter14
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setByte() method to
	 *                    set minimum Smallint value in maximum value column in Smallint table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getByte method.  It should return a byte value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter14() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

			String sMinByteVal = rsSch.extractVal("Smallint_Tab",2,sqlp,conn);
			short minByteVal=Short.parseShort(sMinByteVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Smallint_Io_Max(?)}");
			cstmt.setShort(1,minByteVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getByte(MAX_VAL)");
			//invoke getByte method
			short oRetVal = cstmt.getShort(1);
			logMsg("Returned Value from ctssql.stmt:" + minByteVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minByteVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter15
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setShort() method to
	 *                    set maximum Tinyint value in null column of Tinyint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getShort method.  It should return a short value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter15() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

			String sMaxShortVal = rsSch.extractVal("Tinyint_Tab",1,sqlp,conn);
			byte maxShortVal = Byte.parseByte(sMaxShortVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_Io_Null(?)}");
			cstmt.setByte(1,maxShortVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TINYINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getShort(NULL_VAL)");
			//invoke getShort method
			byte oRetVal = cstmt.getByte(1);
			logMsg("Returned Value from ctssql.stmt:" + maxShortVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxShortVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter16
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setShort() method to
	 *                    set minimum Tinyint value in maximum value column in Tinyint table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getShort method.  It should return a short value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter16() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

			String sMinShortVal = rsSch.extractVal("Tinyint_Tab",2,sqlp,conn);
			byte minShortVal=Byte.parseByte(sMinShortVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_Io_Max(?)}");
			cstmt.setByte(1,minShortVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TINYINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getShort(MAX_VAL)");
			//invoke getShort method
			byte oRetVal = cstmt.getByte(1);
			logMsg("Returned Value from ctssql.stmt:" + minShortVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minShortVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testRegisterOutParameter17
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setInt() method to
	 *                    set maximum Integer value in null column of Integer table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getInt method.  It should return a int value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter17() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

			String sMaxIntegerVal = rsSch.extractVal("Integer_Tab",1,sqlp,conn);
			int maxIntegerVal = Integer.parseInt(sMaxIntegerVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Integer_Io_Null(?)}");
			cstmt.setInt(1,maxIntegerVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.INTEGER);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getInt(NULL_VAL)");
			//invoke getInt method
			int oRetVal = cstmt.getInt(1);
			logMsg("Returned Value from ctssql.stmt:" + maxIntegerVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxIntegerVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter18
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setInt() method to
	 *                    set minimum Integer value in maximum value column in Integer table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getInt method.  It should return a int value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter18() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

			String sMinIntegerVal = rsSch.extractVal("Integer_Tab",2,sqlp,conn);
			int minIntegerVal=Integer.parseInt(sMinIntegerVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Integer_Io_Max(?)}");
			cstmt.setInt(1,minIntegerVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.INTEGER);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getInt(MAX_VAL)");
			//invoke getInt method
			int oRetVal = cstmt.getInt(1);
			logMsg("Returned Value from ctssql.stmt:" + minIntegerVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minIntegerVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter19
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setLong() method to
	 *                    set maximum Bigint value in null column of Bigint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getLong method.  It should return a long value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter19() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

			String sMaxLongVal = rsSch.extractVal("Bigint_Tab",1,sqlp,conn);
			long maxLongVal = Long.parseLong(sMaxLongVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Io_Null(?)}");
			cstmt.setLong(1,maxLongVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getLong(NULL_VAL)");
			//invoke getLong method
			long oRetVal = cstmt.getLong(1);
			logMsg("Returned Value from ctssql.stmt:" + maxLongVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxLongVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter20
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setLong() method to
	 *                    set minimum Bigint value in maximum value column in Bigint  table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getLong method.  It should return a long value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter20() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

			String sMinLongVal = rsSch.extractVal("Bigint_Tab",2,sqlp,conn);
			long minLongVal=Long.parseLong(sMinLongVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Io_Max(?)}");
			cstmt.setLong(1,minLongVal);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getLong(MAX_VAL)");
			//invoke getLong method
			long oRetVal = cstmt.getLong(1);
			logMsg("Returned Value from ctssql.stmt:" + minLongVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minLongVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter21
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setString() method to
	 *                    set Char value in null column of Char table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getString method.  It should return a String object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter21() throws Fault
	{
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);

			String sCoffeeName = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			sCoffeeName=sCoffeeName.trim();
			logMsg("Value to be inserted is " + sCoffeeName);
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Char_Io_Null(?)}");
			cstmt.setString(1,sCoffeeName);

			//register the output parameters
			int arraySize = sCoffeeName.length();
			logMsg("Expecting an array of size:" + arraySize);
			cstmt.registerOutParameter(1,java.sql.Types.CHAR,arraySize);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getString(NULL_VAL)");
			//invoke getString method
			String oRetVal = cstmt.getString(1);
			oRetVal = oRetVal.trim();
			logMsg("Returned Value from ctssql.stmt:" +sCoffeeName);
			logMsg("Value returned from table :" +oRetVal);

			if(sCoffeeName.equals(oRetVal))
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter22
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setString() method to
	 *                    set Varchar value in null column of Varchar table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getString method.  It should return a String object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter22() throws Fault
	{
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

			String sCoffeeName = rsSch.extractVal("Varchar_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			sCoffeeName=sCoffeeName.trim();

			//get the CallableStatement object
			cstmt = conn.prepareCall("{call Varchar_Io_Null(?)}");
			cstmt.setString(1,sCoffeeName);
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARCHAR);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getString(NULL_VAL)");
			//invoke getString method
			String oRetVal = cstmt.getString(1);
			oRetVal.trim();
			logMsg("Returned Value from ctssql.stmt:" +sCoffeeName);
			logMsg("Value returned from table :" +oRetVal);

			if(sCoffeeName.equals(oRetVal))
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter23
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setString() method to
	 *                    set Longvarchar value in null column of Longvarchar table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getString method.  It should return a String object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter23() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

			String sCoffeeName = rsSch.extractVal("Longvarchar_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			sCoffeeName=sCoffeeName.trim();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Longvarchar_Io_Null(?)}");
			cstmt.setString(1,sCoffeeName);
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.LONGVARCHAR);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getString(NULL_VAL)");
			//invoke getString method
			String oRetVal = cstmt.getString(1);
			oRetVal.trim();
			logMsg("Returned Value from ctssql.stmt:" +sCoffeeName);
			logMsg("Value returned from table :" +oRetVal);

			if(sCoffeeName.equals(oRetVal))
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter24
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setDate() method to
	 *                    set Date value in null column of Date table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getDate method.  It should return a Date object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter24() throws Fault
	{
		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);

			String sMfgDate = rsSch.extractVal("Date_Tab",1,sqlp,conn);
			sMfgDate = sMfgDate.substring(sMfgDate.indexOf('\'')+1,sMfgDate.lastIndexOf('\''));
			java.sql.Date mfgDate =java.sql.Date.valueOf(sMfgDate);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Date_Io_Null(?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DATE);
			cstmt.setDate(1,mfgDate);
			
			//execute the procedure
			cstmt.executeUpdate();
			
			logMsg("Calling CallableStatement.getDate(NULL_VAL)");
			//invoke getDate method			
			java.util.Date objRetVal = (java.util.Date) cstmt.getDate(1);
			long lDate = objRetVal.getTime();
			java.sql.Date oRetVal = new java.sql.Date(lDate);
			
			logMsg("Returned Value from ctssql.stmt:" +mfgDate);
			logMsg("Value returned from table :" +oRetVal);

			if(mfgDate.compareTo(oRetVal)==0)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Date_Tab",conn);
			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter25
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setTime() method to
	 *                    set Time value in null column of Time table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getTime method.  It should return a Time object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter25() throws Fault
	{
		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);

			String sBrkTime = rsSch.extractVal("Time_Tab",1,sqlp,conn);
			sBrkTime = sBrkTime.substring(sBrkTime.indexOf('\'')+1,sBrkTime.lastIndexOf('\''));
			java.sql.Time brkTime = java.sql.Time.valueOf(sBrkTime);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Time_Io_Null(?)}");

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIME);

			cstmt.setTime(1,brkTime);
			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getTime(NULL_VAL)");
			//invoke getTime method
			java.util.Date objRetVal = (java.util.Date) cstmt.getTime(1);
			long lDate = objRetVal.getTime();
			java.sql.Time oRetVal = new java.sql.Time(lDate);
			logMsg("Returned Value from ctssql.stmt:" +brkTime);
			logMsg("Value returned from table :" +oRetVal);

			if(brkTime.toString().trim().equals(oRetVal.toString().trim()))
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Time_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter26
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setTimestamp() method to
	 *                    set Timestamp value in null column of Timestamp table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getTimestamp method.  It should return a Timestamp object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter26() throws Fault
	{
		String sInTime=null;
		java.sql.Timestamp inTimestamp = null;
		try
		{
			rsSch.createTab("Timestamp_Tab",sqlp,conn);

			sInTime = rsSch.extractVal("Timestamp_Tab",1,sqlp,conn);
			sInTime=sInTime.substring(sInTime.indexOf('\'')+1,sInTime.lastIndexOf('\''));
			inTimestamp=Timestamp.valueOf(sInTime);
			logMsg("Timestamp value to be updated   :   " + inTimestamp);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Timestamp_Io_Null(?)}");

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIMESTAMP);
			cstmt.setTimestamp(1,inTimestamp);
			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getTimestamp(NULL_VAL)");
			//invoke getTimestamp method
			java.sql.Timestamp oRetVal = cstmt.getTimestamp(1);
			logMsg("Returned Value from ctssql.stmt:" +inTimestamp);
			logMsg("Value returned from table :" +oRetVal);

			if(inTimestamp.equals(oRetVal))
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Timestamp_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter27
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBytes() method to
	 *                    set Binary value in Binary table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getBytes method.  It should return a Byte Array object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter27() throws Fault
	{
		byte retByteArr[]=null;
		boolean byteArrFlag=false;
		String binarySize=null;

		try
		{
			rsSch.createTab("Binary_Tab",sqlp,conn);

			binarySize = sqlp.getProperty("binarySize");
			logMsg("Binary Table Size : " + binarySize);

			int bytearrsize = Integer.parseInt(binarySize);
			logMsg("Binary Size : " + bytearrsize);

			byte[] bytearr=new byte[bytearrsize];
			String sbyteval=null;

			// to get the bytearray value
			for (int count=0;count<bytearrsize;count++)
			{
				sbyteval=Integer.toString(count%255);
				bytearr[count]=Byte.parseByte(sbyteval);
			}

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Binary_Proc_Io(?)}");
			cstmt.setBytes(1,bytearr);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BINARY);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBytes(NULL_VAL)");

			//invoke getBytes method
			retByteArr = cstmt.getBytes(1);

			for(int i=0;i<bytearrsize;i++)
			{
				if (retByteArr[i]!=bytearr[i])
				{
					logErr("registerOutParameter does not register the OUT parameter");
					throw new Fault("Call to registerOutParameter Method is Failed!");
				}
			}
			logMsg("registerOutParameter registers the OUT parameter");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter28
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBytes() method to
	 *                    set Varbinary value in Varbinary table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getBytes method.  It should return a Byte Array object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter28() throws Fault
	{
		byte retByteArr[]=null;
		boolean byteArrFlag=false;
		String varbinarySize=null;

		try
		{
			rsSch.createTab("Varbinary_Tab",sqlp,conn);

			varbinarySize = sqlp.getProperty("varbinarySize");
			logMsg("Varbinary Table Size : " + varbinarySize);

			int bytearrsize = Integer.parseInt(varbinarySize);
			logMsg("Varbinary Size : " + bytearrsize);

			byte[] bytearr=new byte[bytearrsize];
			String sbyteval=null;

			// to get the bytearray value
			for (int count=0;count<bytearrsize;count++)
			{
				sbyteval=Integer.toString(count%255);
				bytearr[count]=Byte.parseByte(sbyteval);
			}

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varbinary_Proc_Io(?)}");
			cstmt.setBytes(1,bytearr);

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARBINARY);

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBytes(NULL_VAL)");

			//invoke getBytes method
			retByteArr = cstmt.getBytes(1);

			for(int i=0;i<bytearrsize;i++)
			{
				if (retByteArr[i]!=bytearr[i])
				{
					logErr("registerOutParameter does not register the OUT parameter");
					throw new Fault("Call to registerOutParameter Method is Failed!");
				}
			}
			logMsg("registerOutParameter registers the OUT parameter");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/* cleanup */
	public void  cleanup() throws Fault
	{
		try
		{

			// Close the database
			rsSch.dbUnConnect(conn);
			logMsg("Cleanup ok;");
		}
		catch (Exception e)
		{
			logErr("An error occurred while closing the database connection");
		}
	}
}
