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

/*
 * @(#)callStmtClient21.java	1.10 02/01/12
 */

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

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 callStmtClient21 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 callStmtClient21 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt21";

	//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)
	{
		callStmtClient21 theTests = new callStmtClient21();
		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:         testRegisterOutParameter29
	 * @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 Longvarbinary value in Longvarbinary 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 testRegisterOutParameter29() throws Fault
	{
		byte retByteArr[]=null;
		boolean byteArrFlag=false;
		String longvarbinarySize=null;

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

			longvarbinarySize = sqlp.getProperty("longvarbinarySize");
			logMsg("Longvarbinary Table Size : " + longvarbinarySize);

			int bytearrsize = Integer.parseInt(longvarbinarySize);
			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 Longvarbinary_Io(?)}");
			cstmt.setBytes(1,bytearr);

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

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

			//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("Longvarbinary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter30
	 * @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 setObject() method to
	 *                    set maximum Double value in null column and call registerOutParameter
	 *                    method and call getObject method.  It should return a Double object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter30() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);

			String sMaxDoubleVal = rsSch.extractVal("Double_Tab",1,sqlp,conn);
			Double maxDoubleVal =  new Double(sMaxDoubleVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Io_Null(?)}");
			cstmt.setDouble(1,maxDoubleVal.doubleValue());

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

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

			if(maxDoubleVal.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("Double_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter31
	 * @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 setObject() method to
	 *                    set minimum double value in maximum value column in Double table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getObject method.  It should return a Double object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter31() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);

			String sMinDoubleVal = rsSch.extractVal("Double_Tab",2,sqlp,conn);
			Double minDoubleVal= new Double(sMinDoubleVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Io_Max(?)}");
			cstmt.setDouble(1,minDoubleVal.doubleValue());

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

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

			if(minDoubleVal.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("Double_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter32
	 * @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 setObject() method to
	 *                    set maximum Float value in null column and call registerOutParameter
	 *                    method and call getObject method.  It should return a Double object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter32() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);


			String sMaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);
			Float maxFloatVal = new Float(sMaxFloatVal);

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

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

			logMsg("Executing the update query");

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

			if(maxFloatVal.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("Float_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter33
	 * @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 setObject() method to
	 *                    set minimum float value in maximum value column in Float table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getObject method.  It should return a Double object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter33() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);

			String sMinFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);
			Double minFloatVal=new Double(sMinFloatVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Io_Max(?)}");
			cstmt.setDouble(1,minFloatVal.doubleValue());

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

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

			if(minFloatVal.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("Float_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter34
	 * @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 setObject() method to
	 *                    set maximum Real value in null column of Real table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Float object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter34() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

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

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

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

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

			if(maxRealVal.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("Real_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter35
	 * @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 setObject() 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 getObject method.  It should return a Float object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter35() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

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

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

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

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

			if(minRealVal.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("Real_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter36
	 * @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 setObject() method to
	 *                    set maximum BIT value in null column of BIT table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Boolean object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter36() throws Fault
	{	
		Boolean oMaxBooleanVal = null;
		boolean booleanVal ;
		String smaxBooleanVal = null;
		String rStringVal = null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

			smaxBooleanVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);
			
			
			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				logMsg("database supports Boolean datatype.");
				oMaxBooleanVal = new Boolean(smaxBooleanVal);
			}
			else
			{
				booleanVal= (smaxBooleanVal.trim().equals("1"))? true : false;
				oMaxBooleanVal = new Boolean(booleanVal);
			}
			
			
			//Boolean maxBooleanVal = new Boolean(smaxBooleanVal);

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

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(NULL_VAL)");
			//invoke getObject method
			
			//Boolean oRetVal = (Boolean) cstmt.getObject(1);
			
			rStringVal = cstmt.getObject(1).toString();
			rStringVal = rStringVal.trim();
			
			
			
			logMsg("Returned Value from ctssql.stmt:" + oMaxBooleanVal);
			logMsg("Value returned from table :" + rStringVal);

			if(rStringVal.equals(oMaxBooleanVal.toString()) || rStringVal.equals(smaxBooleanVal.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("Bit_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter37
	 * @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 setObject() 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 object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter37() throws Fault
	{
		String sminBooleanVal=null;
		boolean booleanVal;
		Boolean oMinBooleanVal=null;
		String rStringVal = null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

			sminBooleanVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);
			
			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				logMsg("database supports Boolean datatype.");
				oMinBooleanVal = new Boolean(sminBooleanVal);
			}
			else
			{
				booleanVal= (sminBooleanVal.trim().equals("1"))? true : false;
				oMinBooleanVal = new Boolean(booleanVal);
			}
			
			//Boolean minBooleanVal= new Boolean(sMinBooleanVal);

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

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(MAX_VAL)");
			//invoke getObject method
			//Boolean oRetVal = (Boolean) cstmt.getObject(1);
			
			rStringVal = cstmt.getObject(1).toString();
			rStringVal = rStringVal.trim();
			
			logMsg("Returned Value from ctssql.stmt:" + oMinBooleanVal);
			logMsg("Value returned from table :" + rStringVal);

			if (rStringVal.equals(oMinBooleanVal.toString()) || rStringVal.equals(sminBooleanVal.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("Bit_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter38
	 * @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 setObject() method to
	 *                    set maximum Smallint value in null column of Smallint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Integer object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter38() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

			String sMaxByteVal = rsSch.extractVal("Smallint_Tab",1,sqlp,conn);
			Short maxByteVal = new Short(sMaxByteVal);
			Integer imaxByteVal = new Integer(sMaxByteVal);

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

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

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

			if(sMaxByteVal.trim().equals(sRetVal.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("Smallint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter39
	 * @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 setObject() 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 Integer object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter39() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

			String sMinByteVal = rsSch.extractVal("Smallint_Tab",2,sqlp,conn);
			Short minByteVal=new Short(sMinByteVal);
			Integer iminByteVal = new Integer(sMinByteVal);

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

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

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

			if(sMinByteVal.trim().equals(sRetVal.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("Smallint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter40
	 * @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 setObject() method to
	 *                    set maximum Tinyint value in null column of Tinyint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Byte object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter40() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

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

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

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(NULL_VAL)");
			//invoke getObject method
			Object obj = cstmt.getObject(1);
			Byte oRetVal = new Byte(obj.toString());
			
			logMsg("Returned Value from ctssql.stmt:" +maxShortVal);
			logMsg("Value returned from table :" +oRetVal);

			if((maxShortVal.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("Tinyint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter41
	 * @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 setObject() method to
	 *                    set minimum Tinyint value in maximum value column in Tinyint table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getObject method.  It should return a Byte object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter41() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

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

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

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(MAX_VAL)");
			//invoke getObject method
			Object obj = cstmt.getObject(1);
			Byte oRetVal = new Byte(obj.toString());
			
			logMsg("Returned Value from ctssql.stmt:" +minShortVal);
			logMsg("Value returned from table :" +oRetVal);

			if((minShortVal.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("Tinyint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testRegisterOutParameter42
	 * @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 setObject() method to
	 *                    set maximum Integer value in null column of Integer table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Integer object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter42() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

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

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

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

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

			if(maxIntegerVal.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("Integer_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter43
	 * @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 setObject() method to
	 *                    set minimum Integer value in maximum value column in Integer table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getObject method.  It should return a Integer object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter43() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

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

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

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

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

			if (minIntegerVal.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("Integer_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter44
	 * @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 setObject() method to
	 *                    set maximum Bigint value in null column of Bigint table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject method.  It should return a Long Object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter44() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Io_Null(?)}");
			cstmt.setLong(1,maxLongVal.longValue());
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);

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

			if(maxLongVal.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("Bigint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter45
	 * @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 setObject() method to
	 *                    set minimum Bigint value in maximum value column in Bigint  table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType)
	 *                    method and call getObject method.  It should return a Long object
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter45() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

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

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

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

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

			if(minLongVal.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("Bigint_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter46
	 * @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 testRegisterOutParameter46() 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();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Char_Io_Null(?)}");
			cstmt.setString(1,sCoffeeName.toString());

			int precision = sCoffeeName.length();

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(NULL_VAL)");
			//invoke getObject method
			String oRetVal = (String) cstmt.getObject(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:         testRegisterOutParameter47
	 * @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 setObject() method to
	 *                    set Varchar value in null column of Varchar table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject 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 testRegisterOutParameter47() 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.toString());

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(NULL_VAL)");
			//invoke getObject method
			String oRetVal = (String) cstmt.getObject(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("Varchar_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter48
	 * @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 setObject() method to
	 *                    set Longvarchar value in null column of Longvarchar table and call
	 *                    registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    and call getObject 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 testRegisterOutParameter48() 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.toString());

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getObject(NULL_VAL)");
			//invoke getObject method
			String oRetVal = (String) cstmt.getObject(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("Longvarcharnull_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");
		}
	}
}
