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

/*
 * @(#)callStmtClient5.java	1.8 02/01/12
 */
package com.sun.cts.tests.jdbc.ee.callStmt.callStmt5;

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 callStmtClient5 class tests methods of DatabaseMetaData interface using
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.7, 06/16/99
 */
public class callStmtClient5 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt5";
	//Naming specific member variables
	private CTSNamingContextInterface jc = null;

	//Harness requirements
	private transient Connection conn = null;
	private rsSchema rsSch=null;
	private String drManager=null;
	private Properties sqlp = null;
	private transient DatabaseMetaData dbmd=null;
	private CallableStatement cstmt=null;
	private Properties props=null;


	/* Run test in standalone mode */
	public static void main(String[] args)
	{
		callStmtClient5 theTests = new callStmtClient5();
		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
			{
				props=p;
				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();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception : " + ex.getMessage());
			}
		}
		catch ( Exception e )
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}


	/*
	 * @testName:         testGetObject41
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Decimal_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject41() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.MinimumValue(JDBC DECIMAL))");

			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Decimal_Tab",2,sqlp,conn);
			BigDecimal oExtVal = new BigDecimal(sRetStr);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);

			if( (oRetVal.compareTo(oExtVal)==0) )
				logMsg("getObject returns the Minimum value for type BigDecimal(JDBC DECIMAL) " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum value for type BigDecimal(JDBC DECIMAL) ");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject42
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Decimal_Tab.Check if it returns null
	 */
	public void testGetObject42() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.NullValue(JDBC DECIMAL))");

			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(3);
			logMsg("Value retrieved using cstmt	:" + oRetVal);

			if(oRetVal == null)
				logMsg("getObject returns the Null value for type BigDecimal(JDBC DECIMAL) " + oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type BigDecimal(JDBC DECIMAL)");
				throw new Fault("Call to getObject Failed!");
			}
		}
 		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject43
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Binary_Val of the Binary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the
	 *                    getObject(int parameterIndex) method to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetObject43() throws Fault
	{
		String binarySize=null;
		PreparedStatement pstmt=null;
		try
		{
			//to extract the Binary Table size from property file
			binarySize = props.getProperty("binarySize");
			logMsg("Binary Table Size : " + binarySize);
			rsSch.createTab("Binary_Tab",sqlp,conn);

			String sPrepStmt = sqlp.getProperty("Binary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);
			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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Binary_Proc(?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BINARY);
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].BinaryArrayValue)");
			//invoke getObject method

			byte[] oRetVal = (byte[])cstmt.getObject(1);
			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getObject did not return the proper byte array values");
					throw new Fault("Call to getObject Failed!");
				}
			}
			logMsg("getObject returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject44
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Binary_Tab.Check if it returns null
	 */
	public void testGetObject44() throws Fault
	{
		String binarySize=null;
		try
		{
			//to extract the Binary Table size from property file
			binarySize = props.getProperty("binarySize");
			logMsg("Binary Table Size : " + binarySize);
			rsSch.createTab("Binary_Tab",sqlp,conn);

			//get the CallableStatement object
			cstmt = conn.prepareCall("{call Binary_Proc(?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BINARY);
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].null)");
			//invoke getObject method

			byte[] oRetVal = (byte[])cstmt.getObject(1);
			if(oRetVal == null)
				logMsg("getObject returns the null value for type byte[]");
			else
			{
				logErr("getObject did not return the null value for type byte[]");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject45
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Varbinary_Val of the Varbinary_tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the
	 *                    getObject(int parameterIndex) method to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetObject45() throws Fault
	{
		String varbinarySize=null;
		PreparedStatement pstmt=null;
		try
		{
			// to extract the varbinary Table size from property file
			varbinarySize = props.getProperty("varbinarySize");
			logMsg("varbinary Table Size : " + varbinarySize);

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

   			String sPrepStmt = sqlp.getProperty("Varbinary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);

			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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varbinary_Proc(?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARBINARY);
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].VarbinaryArrayValue)");

			//invoke getObject method
			byte[] oRetVal = (byte[])cstmt.getObject(1);
			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getObject did not return the proper byte array values");
					throw new Fault("Call to getObject Failed!");
				}
			}
			logMsg("getObject returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject46
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Varbinary_Tab.Check if it returns null
	 */
	public void testGetObject46() throws Fault
	{
		String varbinarySize=null;
		try
		{
			// to extract the varbinary Table size from property file
			varbinarySize = props.getProperty("varbinarySize");
			logMsg("varbinary Table Size : " + varbinarySize);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].null)");
			//invoke getObject method
			byte[] oRetVal = (byte[])cstmt.getObject(1);

			if(oRetVal == null)
				logMsg("getObject returns the null value for type byte[]");
			else
			{
				logErr("getObject did not return the null value for type byte[]");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject47
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Longvarbinary_Val of the Longvarbinary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the
	 *                    getObject(int parameterIndex) method.to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetObject47() throws Fault
	{
		String longvarbinarySize=null;
		PreparedStatement pstmt=null;
		try
		{
			rsSch.createTab("Longvarbinary_Tab",sqlp,conn);
			// to extract the longvarbinary Table size from property file
			longvarbinarySize = props.getProperty("longvarbinarySize");
			logMsg("longvarbinary Table Size : " + longvarbinarySize);

			String sPrepStmt = sqlp.getProperty("Longvarbinary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);
			int bytearrsize = Integer.parseInt(longvarbinarySize);
			logMsg("longvarbinary 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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].LongvarbinaryArrayValue)");
			//invoke getObject method
			byte[] oRetVal = (byte[])cstmt.getObject(1);

			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getObject did not return the proper byte array values");
					throw new Fault("Call to getObject Failed!");
				}
			}
			logMsg("getObject returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject48
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from from Longvarbinary_Tab.Check if it returns null
	 */
	public void testGetObject48() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarbinary_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(byte[].nullvalue)");

			//invoke getObject method
			byte[] oRetVal = (byte[])cstmt.getObject(1);

			if(oRetVal == null)
				logMsg("getObject returns the null value for type byte[]");
			else
			{
				logErr("getObject did not return the null value for type byte[]");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetFloat01
	 * @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 getFloat(int parameterIndex) gets the value of a JDBC FLOAT
	 *                    parameter as a float in the Java programming language.If the value
	 *                    is SQL NULL,the result is 0.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getFloat(int parameterIndex) method to retrieve the maximum value from Real_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getFloat(int parameterIndex).
	 *                    Both the values should be equal.
	 */
	public void testGetFloat01() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getFloat(MaximumValue)");

			//invoke getFloat method
			float fRetVal = cstmt.getFloat(1);
			String sRetStr = rsSch.extractVal("Real_Tab",1,sqlp,conn);
			float fExtVal = Float.parseFloat(sRetStr);
			logMsg("Value retrieved using cstmt	:" + fRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + fExtVal);

			if(fRetVal==fExtVal)
				logMsg("getFloat returns the Maximum Value " + fRetVal);
			else
			{
				logErr("getFloat did not return the Maximum Value");
				throw new Fault("Call to getFloat Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getFloat is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getFloat Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetFloat02
	 * @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 getFloat(int parameterIndex) gets the value of a JDBC FLOAT
	 *                    parameter as a float in the Java programming language.If the value
	 *                    is SQL NULL,the result is 0.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getFloat(int parameterIndex) method to retrieve the minimum value from Real_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getFloat(int parameterIndex).
	 *                    Both the values should be equal.
	 */
	public void testGetFloat02() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getFloat(MinimumValue)");

			//invoke getFloat method
			float fRetVal = cstmt.getFloat(2);
			String sRetStr = rsSch.extractVal("Real_Tab",2,sqlp,conn);
			float fExtVal = Float.parseFloat(sRetStr);
			logMsg("Value retrieved using cstmt	:" + fRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + fExtVal);

			if(fRetVal==fExtVal)
				logMsg("getFloat returns the Minimum Value " + fRetVal);
			else
			{
				logErr("getFloat did not return the Minimum Value ");
				throw new Fault("Call to getFloat Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getFloat is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getFloat Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetFloat03
	 * @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 getFloat(int parameterIndex) gets the value of a JDBC FLOAT
	 *                    parameter as a float in the Java programming language.If the value
	 *                    is SQL NULL,the result is 0.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getFloat(int parameterIndex) method to retrieve the null value
	 *                    from Real_Tab. Check if it returns null
	 */
	public void testGetFloat03() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getFloat(NullValue)");

			//invoke getFloat method
			float fRetVal = cstmt.getFloat(3);
			logMsg("Value retrieved using cstmt	:" + fRetVal);

			if(cstmt.wasNull())
				logMsg("getFloat returns the Null Value " + fRetVal);
			else
			{
				logErr("getFloat did not return the Null Value ");
				throw new Fault("Call to getFloat Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getFloat is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getFloat Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetString03
	 * @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 getString(int parameterIndex) method retrieves the value of a
	 *                    JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the
	 *                    Java programming language.If the value is SQL NULL, the result is
	 *                    null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getString(int parameterIndex) method to retrieve a String value from Varchar_Tab
	 *                    Extract the same String value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getString(int parameterIndex).
	 *                    Both the values should be equal.
	 */
	public void testGetString03() throws Fault
	{
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getString(Name(JDBC VARCHAR))");

			//invoke getString method
			String oRetVal = (String)cstmt.getString(1);
			String oExtVal = rsSch.extractVal("Varchar_Tab",1,sqlp,conn);
			oExtVal=oExtVal.trim();
			oRetVal=oRetVal.trim();

			if(oRetVal.equals(oExtVal.substring(1,oExtVal.length()-1)))
				logMsg("getString returns the Name " + oRetVal);
			else
			{
				logErr("getString did not return the Name ");
				throw new Fault("Call to getString Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getString Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetString04
	 * @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 getString(int parameterIndex) method retrieves the value of a
	 *                    JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the
	 *                    Java programming language.If the value is SQL NULL, the result is
	 *                    null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getString(int parameterIndex) method to retrieve the null value
	 *                    from Varchar_Tab. Check if it returns null
	 */
	public void testGetString04() throws Fault
	{
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getString(NullValue(JDBC VARCHAR))");

			//invoke getString method
			String oRetVal = (String)cstmt.getString(2);

			if(oRetVal ==  null)
				logMsg("getString returns the null value " + oRetVal);
			else
			{
				logErr("getString did not return the null value");
				throw new Fault("Call to getString Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getString Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetString05
	 * @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 getString(int parameterIndex) method retrieves the value of a
	 *                    JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the
	 *                    Java programming language.If the value is SQL NULL, the result is
	 *                    null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getString(int parameterIndex) method to retrieve a String value from Longvarchar_Tab.
	 *                    Extract the same String value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getString(int parameterIndex).
	 *                    Both the values should be equal.
	 */
	public void testGetString05() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarchar_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getString(Name(JDBC LONGVARCHAR))");

			//invoke getString method
			String oRetVal = (String)cstmt.getString(1);
			String oExtVal = rsSch.extractVal("Longvarchar_Tab",1,sqlp,conn);
			oExtVal=oExtVal.trim();
			oRetVal=oRetVal.trim();

			if(oRetVal.equals(oExtVal.substring(1,oExtVal.length()-1)))
				logMsg("getString returns the Name " + oRetVal);
			else
			{
				logErr("getString did not return the Name");
				throw new Fault("Call to getString Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getString Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetString06
	 * @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 getString(int parameterIndex) method retrieves the value of a
	 *                    JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the
	 *                    Java programming language.If the value is SQL NULL, the result is
	 *                    null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getString(int parameterIndex) method to retrieve the null value
	 *                    from Longvarchar_Tab. Check if it returns null
     */
	public void testGetString06() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.LONGVARCHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getString(NullValue(JDBC LONGVARCHAR))");

			//invoke getString method
			String oRetVal = (String)cstmt.getString(1);

			if(oRetVal ==  null)
				logMsg("getString returns the null value " + oRetVal);
			else
			{
				logErr("getString did not return the null value");
				throw new Fault("Call to getString Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getString Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBigDecimal04
	 * @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 getBigDecimal(int parameterIndex) method gets the value of a
	 *                    JDBC Numeric parameter value as a java.math.BigDecimal object with
	 *                    full precision.  If the value is SQL NULL, the value returned will
	 *                    be null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBigDecimal(int parameterIndex) method.to retrieve the
	 *                    maximum value from Decimal_Tab. Extract the maximum value from the ctssql.stmt
	 *                    file.Compare this value with the value returned by the
	 *                    getBigDecimal(int parameterIndex).Both the values should be
	 *                    equal.
	 */
	public void testGetBigDecimal04() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBigDecimal(MaximumValue(JDBC DECIMAL))");

			//invoke getBigDecimal method
			BigDecimal oRetVal = cstmt.getBigDecimal(1);
			String sRetStr = rsSch.extractVal("Decimal_Tab",1,sqlp,conn);
			BigDecimal oExtVal = new BigDecimal(sRetStr);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);

			if( (oRetVal.compareTo(oExtVal)==0 ) )
				logMsg("getBigDecimal returns the Maximum value " + oRetVal);
			else
			{
				logErr("getBigDecimal did not return the Maximum value");
				throw new Fault("Call to getBigDecimal Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBigDecimal is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBigDecimal Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBigDecimal05
	 * @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 getBigDecimal(int parameterIndex) method gets the value of a
	 *                    JDBC Numeric parameter value as a java.math.BigDecimal object with
	 *                    full precision.  If the value is SQL NULL, the value returned will
	 *                    be null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBigDecimal(int parameterIndex) method to retrieve the
	 *                    minimum value from Decimal_Tab. Extract the minimum value from the ctssql.stmt
	 *                    file.Compare this value with the value returned by the
	 *                    getBigDecimal(int parameterIndex).Both the values should be
	 *                    equal.
	 */
	public void testGetBigDecimal05() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBigDecimal(MinimumValue(JDBC DECIMAL))");

			//invoke getBigDecimal method
			BigDecimal oRetVal = cstmt.getBigDecimal(2);
			String sRetStr = rsSch.extractVal("Decimal_Tab",2,sqlp,conn);
			BigDecimal oExtVal = new BigDecimal(sRetStr);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);

			if( (oRetVal.compareTo(oExtVal)==0 ) )
				logMsg("getBigDecimal returns the Minimum value " + oRetVal);
			else
			{
				logErr("getBigDecimal did not return the Minimum value");
				throw new Fault("Call to getBigDecimal Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBigDecimal is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBigDecimal Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBigDecimal06
	 * @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 getBigDecimal(int parameterIndex) method gets the value of a
	 *                    JDBC Numeric parameter value as a java.math.BigDecimal object with
	 *                    full precision.  If the value is SQL NULL, the value returned will
	 *                    be null.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBigDecimal(int parameterIndex) method to retrieve the
	 *                    null value from Decimal_Tab.Check if it returns null
	 */
	public void testGetBigDecimal06() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBigDecimal(NullValue(JDBC DECIMAL))");

			//invoke getBigDecimal method
			BigDecimal oRetVal = cstmt.getBigDecimal(3);
			logMsg("Value retrieved using cstmt	:" + oRetVal);

			if(oRetVal == null)
				logMsg("getBigDecimal returns the Null value " + oRetVal);
			else
			{
				logErr("getBigDecimal did not return the Null value");
				throw new Fault("Call to getBigDecimal Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBigDecimal is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBigDecimal Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes01
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Binary_Val of the Binary with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetBytes01() throws Fault
	{
		String binarySize=null;
		PreparedStatement pstmt=null;
		try
		{
			rsSch.createTab("Binary_Tab",sqlp,conn);
			binarySize = props.getProperty("binarySize");

			String sPrepStmt = sqlp.getProperty("Binary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);

			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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Binary_Proc(?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BINARY);
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBytes(BinaryArrayValue)");

			//invoke getBytes method
			byte[] oRetVal = cstmt.getBytes(1);
			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getBytes did not return the proper byte array values");
					throw new Fault("Call to getBytes Failed!");
				}
			}
			logMsg("getBytes returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes02
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method to retrieve the null value
	 *                    from Binary_Tab. Check if it returns null.
	 */
	public void testGetBytes02() throws Fault
	{
		String binarySize=null;
		try
		{
			// to extract the Binary Table size from property file
			binarySize = props.getProperty("binarySize");
			logMsg("Binary Table Size : " + binarySize);

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

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBytes(null)");
			//invoke getBytes method
			byte[] oRetVal = cstmt.getBytes(1);

			if(oRetVal == null)
				logMsg("getBytes returns the null value");
			else
			{
				logErr("getBytes did not return the null value");
				throw new Fault("Call to getBytes Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes03
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Varbinary_Val of the Varbinary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method.to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetBytes03() throws Fault
	{
		String varbinarySize=null;
		PreparedStatement pstmt=null;

		//String sKeyName=null;
		//String sProductName=null;
		//String createString=null,createString1=null,createString2=null;
		//String executeString=null;
		try
		{
			// to extract the varbinary Table size from property file
			varbinarySize = props.getProperty("varbinarySize");
			logMsg("varbinary Table Size : " + varbinarySize);

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


			String sPrepStmt = sqlp.getProperty("Varbinary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);

			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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

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

			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBytes(VarbinaryArrayValue)");
			//invoke getBytes method
			byte[] oRetVal = cstmt.getBytes(1);
			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getBytes did not return the proper byte array values");
					throw new Fault("Call to getBytes Failed!");
				}
			}
			logMsg("getBytes returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes04
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method.to retrieve the null value
	 *                    from Varbinary_Tab. Check if it returns null.
	 */
	 public void testGetBytes04() throws Fault
	{
		String varbinarySize=null;
		try
		{
			// to extract the varbinary Table size from property file
			varbinarySize = props.getProperty("varbinarySize");
			logMsg("varbinary Table Size : " + varbinarySize);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varbinary_Proc(?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARBINARY);
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBytes(null)");
			//invoke getObject method
			byte[] oRetVal = cstmt.getBytes(1);

			if(oRetVal == null)
				logMsg("getBytes returns the null value");
			else
			{
				logErr("getBytes did not return the null value");
				throw new Fault("Call to getBytes Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes05
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Update the column Longvarbinary_Val of the Longvarbinary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method.to retrieve the byte array.
	 *                    It should return the byte array object that has been set.
	 */
	public void testGetBytes05() throws Fault
	{
		String longvarbinarySize=null;
		PreparedStatement pstmt=null;
		try
		{
			rsSch.createTab("Longvarbinary_Tab",sqlp,conn);
			// to extract the longvarbinary Table size from property file
			longvarbinarySize = props.getProperty("longvarbinarySize");
			logMsg("longvarbinary Table Size : " + longvarbinarySize);


			String sPrepStmt = sqlp.getProperty("Longvarbinary_Tab_Val_Update","");
			logMsg("Prepared Statement String :" + sPrepStmt);
			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 PreparedStatement object
			pstmt= conn.prepareStatement(sPrepStmt);
			pstmt.setBytes(1,bytearr);
			pstmt.executeUpdate();

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


			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getBytes(LongvarbinaryArrayValue)");
			//invoke getBytes method
			byte[] oRetVal = cstmt.getBytes(1);
			for(int i=0;i<bytearrsize;i++)
			{
				if(oRetVal[i]!=bytearr[i])
				{
					logErr("getBytes did not return the proper byte array values");
					throw new Fault("Call to getBytes Failed!");
				}
			}
			logMsg("getBytes returns the proper byte array values");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(pstmt!=null)
				{
					pstmt.close();
					pstmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarbinary_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetBytes06
	 * @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 getBytes(int parameterIndex) method gets the value
	 *                    of a JDBC BINARY or VARBINARY parameter as an array of
	 *                    byte values in the Java programming language.
	 *                    If the value is SQL NULL, the result is null.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Execute the stored procedure and call the
	 *                    getBytes(int parameterIndex) method.to retrieve the
	 *                    null value from Longvarbinary_Tab.Check if it returns null
	 *
	 */
	public void testGetBytes06() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarbinary_Tab",sqlp,conn);

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

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

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

			//invoke getBytes method
			byte[] oRetVal = cstmt.getBytes(1);

			if(oRetVal == null)
				logMsg("getBytes returns the null value");
			else
			{
				logErr("getBytes did not return the null value");
				throw new Fault("Call to getBytes Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getBytes is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getBytes Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarbinary_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");
		}
	}
}
