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

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

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

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

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

	//Harness requirements

	private transient Connection conn = null;
	//private ResultSet rs=null;
	private rsSchema rsSch=null;
	private	String drManager=null;
	private Properties sqlp = null;
	private transient DatabaseMetaData dbmd=null;
	private Statement stmt=null;
	private	CallableStatement cstmt=null;
	private Properties props=null;

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


	/*
	 * @testName:         testSetObject41
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type FLOAT and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Double object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject41() throws Fault
	{
		ResultSet rs =null;
		Double oRetVal=null;
		Double minFloatVal=null;
		String sMinFloatVal=null;

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

			sMinFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);

			minFloatVal= new Double(sMinFloatVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_In_Null(?)}");
			cstmt.setObject(1,sMinFloatVal,java.sql.Types.FLOAT);
			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Float_Query_Null","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = (Double) rs.getObject(1);
			logMsg("Returned Value from ctssql.stmt:"+ minFloatVal);
			logMsg("Returned Value from database:"+ oRetVal);

			if (oRetVal.equals(minFloatVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);
			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testSetObject42
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type DOUBLE and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Double object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject42() throws Fault
	{
		ResultSet rs =null;
		Double oRetVal=null;
		Double maxDoubleVal=null;
		String sMaxDoubleVal=null;

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

			sMaxDoubleVal = rsSch.extractVal("Double_Tab",1,sqlp,conn);

			maxDoubleVal= new Double(sMaxDoubleVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_In_Min(?)}");
			cstmt.setObject(1,sMaxDoubleVal,java.sql.Types.DOUBLE);

			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Double_Query_Min","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = (Double) rs.getObject(1);
			logMsg("Returned Value from ctssql.stmt:"+ maxDoubleVal);
			logMsg("Returned Value from database:"+ oRetVal);

			if (oRetVal.equals(maxDoubleVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Double_Tab",conn);
			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testSetObject43
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type DOUBLE and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Double object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject43() throws Fault
	{
		ResultSet rs =null;
		Double oRetVal=null;
		Double minDoubleVal=null;
		String sMinDoubleVal=null;

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

			sMinDoubleVal = rsSch.extractVal("Double_Tab",2,sqlp,conn);

			minDoubleVal= new Double(sMinDoubleVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_In_Null(?)}");
			cstmt.setObject(1,sMinDoubleVal,java.sql.Types.DOUBLE);
			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Double_Query_Null","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = (Double) rs.getObject(1);
			logMsg("Returned Value from ctssql.stmt:"+ minDoubleVal);
			logMsg("Returned Value from database:"+ oRetVal);

			if (oRetVal.equals(minDoubleVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Double_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject44
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type DECIMAL and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a BigDecimal object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject44() throws Fault
	{
		ResultSet rs =null;
		Object oRetVal=null;
		BigDecimal maxDecimalVal=null;
		String sMaxDecimalVal=null;

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

			sMaxDecimalVal = rsSch.extractVal("Decimal_Tab",1,sqlp,conn);

			maxDecimalVal= new BigDecimal(sMaxDecimalVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Decimal_In_Max(?)}");
			cstmt.setObject(1,sMaxDecimalVal,java.sql.Types.DECIMAL,15);

			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Decimal_Query_Max","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = rs.getObject(1);
			BigDecimal bRetVal = new BigDecimal(oRetVal.toString());
			
			logMsg("Returned Value from ctssql.stmt:"+ maxDecimalVal);
			logMsg("Returned Value from database see :"+ bRetVal);

			if ( bRetVal.compareTo(maxDecimalVal)==0 )
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testSetObject45
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type DECIMAL and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a BigDecimal object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject45() throws Fault
	{
		ResultSet rs =null;
		Object oRetVal=null;
		BigDecimal minDecimalVal=null;
		String sMinDecimalVal=null;

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

			sMinDecimalVal = rsSch.extractVal("Decimal_Tab",2,sqlp,conn);

			minDecimalVal= new BigDecimal(sMinDecimalVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Decimal_In_Null(?)}");
			cstmt.setObject(1,sMinDecimalVal,java.sql.Types.DECIMAL,15);
			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Decimal_Query_Null","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = rs.getObject(1);
			BigDecimal bRetVal = new BigDecimal(oRetVal.toString());
			logMsg("Returned Value from ctssql.stmt:"+ minDecimalVal);
			logMsg("Returned Value from database:"+ bRetVal);

			if ( bRetVal.compareTo(minDecimalVal)==0 )
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testSetObject46
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type NUMERIC and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a BigDecimal object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject46() throws Fault
	{
		ResultSet rs =null;
		Object oRetVal=null;
		BigDecimal maxNumericVal=null;
		String sMaxNumericVal=null;

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

			sMaxNumericVal = rsSch.extractVal("Numeric_Tab",1,sqlp,conn);

			maxNumericVal= new BigDecimal(sMaxNumericVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_In_Max(?)}");
			cstmt.setObject(1,sMaxNumericVal,java.sql.Types.NUMERIC,15);

			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Numeric_Query_Max","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal =  rs.getObject(1);
			BigDecimal bRetVal = new BigDecimal(oRetVal.toString());
			logMsg("Returned Value from ctssql.stmt:"+ maxNumericVal);
			logMsg("Returned Value from database:"+ bRetVal);

			if ( bRetVal.compareTo(maxNumericVal)==0 )
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testSetObject47
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type NUMERIC and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a BigDecimal object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject47() throws Fault
	{
		ResultSet rs =null;
		Object oRetVal=null;
		BigDecimal minNumericVal=null;
		String sMinNumericVal=null;

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

			sMinNumericVal = rsSch.extractVal("Numeric_Tab",2,sqlp,conn);

			minNumericVal= new BigDecimal(sMinNumericVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_In_Null(?)}");
			cstmt.setObject(1,sMinNumericVal,java.sql.Types.NUMERIC,15);
			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Numeric_Query_Null","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = rs.getObject(1);
			BigDecimal bRetVal = new BigDecimal(oRetVal.toString());
			logMsg("Returned Value from ctssql.stmt:"+ minNumericVal);
			logMsg("Returned Value from database:"+ bRetVal);

			if( bRetVal.compareTo(minNumericVal)==0 )
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject48
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type BIT and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Boolean object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject48() throws Fault
	{
		ResultSet rs =null;
		Boolean oRetVal=null;
		Boolean maxBooleanVal=null;
		String sMaxBooleanVal=null;

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

			sMaxBooleanVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);

			maxBooleanVal= new Boolean(sMaxBooleanVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_In_Min(?)}");
			cstmt.setObject(1,sMaxBooleanVal,java.sql.Types.BIT);

			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Bit_Query_Min","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = (Boolean) rs.getObject(1);
			
			logMsg("Returned Value from ctssql.stmt:"+ maxBooleanVal);
			logMsg("Returned Value from database:"+ oRetVal);

			if (oRetVal.equals(maxBooleanVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch (Exception e) {}
		}
	}



	/*
	 * @testName:         testSetObject49
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type BIT and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Boolean object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject49() throws Fault
	{
		ResultSet rs =null;
		Boolean oRetVal=null;
		Boolean minBooleanVal=null;
		String sMinBooleanVal=null;

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

			sMinBooleanVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);

			minBooleanVal= new Boolean(sMinBooleanVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_In_Null(?)}");
			cstmt.setObject(1,sMinBooleanVal,java.sql.Types.BIT);
			//execute the procedure
			cstmt.executeUpdate();

			String Min_Val_Query=sqlp.getProperty("Bit_Query_Null","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();
			oRetVal = (Boolean) rs.getObject(1);
			logMsg("Returned Value from ctssql.stmt:"+ minBooleanVal);
			logMsg("Returned Value from database:"+ oRetVal);

			if (oRetVal.equals(minBooleanVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject50
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type CHAR and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a String object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject50() throws Fault
	{
		ResultSet rs =null;
		String oRetVal=null;
		String sCoffeeName=null;

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

			sCoffeeName = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Char_In_Null(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.CHAR);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Char_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (String) rs.getObject(1);
			logMsg("Return Value from ctssql.stmt :" +sCoffeeName);
			logMsg("Return Value from table :" +oRetVal);

			if (oRetVal.trim().equals(sCoffeeName.trim()))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject51
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type VARCHAR and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a String object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject51() throws Fault
	{
		ResultSet rs =null;
		String oRetVal=null;
		String sCoffeeName=null;

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

			sCoffeeName = rsSch.extractVal("Varchar_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varchar_In_Null(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.VARCHAR);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Varchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (String) rs.getObject(1);

			oRetVal.trim();
			sCoffeeName.trim();
			logMsg("Return Value from ctssql.stmt :" +sCoffeeName);
			logMsg("Return Value from table :" +oRetVal);

			if (oRetVal.equals(sCoffeeName))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject52
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type LONGVARCHAR and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a String object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject52() throws Fault
	{
		ResultSet rs =null;
		String oRetVal=null;
		String sCoffeeName=null;

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

			sCoffeeName = rsSch.extractVal("Longvarchar_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Longvarchar_In_Null(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.LONGVARCHAR);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Longvarchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (String) rs.getObject(1);
			oRetVal = oRetVal.trim();
			sCoffeeName = sCoffeeName.trim();
			logMsg("Return Value from ctssql.stmt :" +sCoffeeName);
			logMsg("Return Value from table :" +oRetVal);

			if (oRetVal.equals(sCoffeeName))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject53
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type BINARY and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a Byte Array object that is been set.
	 *
	 */
	public void testSetObject53() throws Fault
	{
		ResultSet rs =null;
		byte[] oRetVal=null;
		byte[] bytearrVal=null;
		String binarySize=null;
		String sbyteval=null;
		String sCoffeeName = null;
		try
		{
			binarySize = sqlp.getProperty("binarySize");
			logMsg("Binary Table Size : " + binarySize);

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

			int bytearrsize = Integer.parseInt(binarySize);
			logMsg("Binary Size : " + bytearrsize);					
			
			sCoffeeName = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);
			
			byte[] bytearr = sCoffeeName.getBytes();
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Binary_Proc_In(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.BINARY);
			//execute the procedure
			cstmt.executeUpdate();

			String Binary_Val_Query=sqlp.getProperty("Binary_Query_Val","");
			logMsg(Binary_Val_Query);
			rs=stmt.executeQuery(Binary_Val_Query);
			rs.next();
			oRetVal = (byte[]) rs.getObject(1);						
						
			logMsg("Inserted Value in bytes :" + bytearr);
			logMsg("Database Value oRetVal :" + oRetVal);

			for(int i=0;i<bytearr.length;i++)
			{
				logMsg("Count : " + i);
				if (oRetVal[i]!=bytearr[i])
				{
					logErr("setObject Method does not set the designated parameter with the object");
					throw new Fault("Call to setObject Method is Failed!");
				}				
			}
			logMsg("setObject Method sets the designated parameter with the object");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject54
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type VARBINARY and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a Byte Array object that is been set.
	 *
	 */
	public void testSetObject54() throws Fault
	{
		ResultSet rs =null;
		byte[] oRetVal=null;
		byte[] bytearrVal=null;
		String varbinarySize=null;
		String sbyteval=null;
		try
		{
			varbinarySize = sqlp.getProperty("varbinarySize");
			logMsg("Varbinary Table Size : " + varbinarySize);

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

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

			String sCoffeeName = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);
			
			byte[] bytearr = sCoffeeName.getBytes();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varbinary_Proc_In(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.VARBINARY);
			//execute the procedure
			cstmt.executeUpdate();

			String Varbinary_Val_Query=sqlp.getProperty("Varbinary_Query_Val","");
			logMsg(Varbinary_Val_Query);
			rs=stmt.executeQuery(Varbinary_Val_Query);
			rs.next();
			oRetVal = (byte[]) rs.getObject(1);

			for(int i=0;i<bytearr.length;i++)
			{
				if (oRetVal[i]!=bytearr[i])
				{
					logErr("setObject Method does not set the designated parameter with the object");
					throw new Fault("Call to setObject Method is Failed!");
				}
			}
			logMsg("setObject Method sets the designated parameter with the object");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject55
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type LONGVARBINARY and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a Byte Array object that is been set.
	 *
	 */
	public void testSetObject55() throws Fault
	{
		ResultSet rs =null;
		byte[] oRetVal=null;
		byte[] bytearrVal=null;
		String longvarbinarySize=null;
		String sbyteval=null;
		try
		{
			longvarbinarySize = sqlp.getProperty("longvarbinarySize");
			logMsg("Longvarbinary Table Size : " + longvarbinarySize);

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

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

			String sCoffeeName = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			sCoffeeName=sCoffeeName.substring(1,sCoffeeName.length()-1);
			logMsg("String to be updated  " + sCoffeeName);
			
			byte[] bytearr = sCoffeeName.getBytes();

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Longvarbinary_Proc_In(?)}");
			cstmt.setObject(1,sCoffeeName,java.sql.Types.LONGVARBINARY);
			//execute the procedure
			cstmt.executeUpdate();

			String Longvarbinary_Val_Query=sqlp.getProperty("Longvarbinary_Query_Val","");
			logMsg(Longvarbinary_Val_Query);
			rs=stmt.executeQuery(Longvarbinary_Val_Query);
			rs.next();
			oRetVal = (byte[]) rs.getObject(1);

			for(int i=0;i<bytearr.length;i++)
			{
				logMsg("Comparing ..." +i);
				if (oRetVal[i]!=bytearr[i])
				{
					logErr("setObject Method does not set the designated parameter with the object");
					throw new Fault("Call to setObject Method is Failed!");
				}
			}
			logMsg("setObject Method sets the designated parameter with the object");
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarbinary_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject56
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type DATE and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Date object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject56() throws Fault
	{
		ResultSet rs =null;
		java.util.Date oRetVal=null;
		java.sql.Date mfgDateVal=null;
		String sMfgDateVal = null ;
		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);

			// to convert String value into java.sql.Date value
			sMfgDateVal = rsSch.extractVal("Date_Tab",1,sqlp,conn);
			sMfgDateVal=sMfgDateVal.substring(sMfgDateVal.indexOf('\'')+1,sMfgDateVal.lastIndexOf('\''));
			mfgDateVal=java.sql.Date.valueOf(sMfgDateVal);
			logMsg("Date value to be updated   :   " + mfgDateVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Date_In_Null(?)}");
			cstmt.setObject(1,sMfgDateVal,java.sql.Types.DATE);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Date_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (java.util.Date) rs.getObject(1);			
			
			long lDate = oRetVal.getTime();			
			java.sql.Date dbDate = new java.sql.Date(lDate);								
			
			logMsg("Return Value from ctssql.stmt :" +mfgDateVal);
			logMsg("Return Value from table :" +dbDate);

			if (dbDate.compareTo(mfgDateVal)==0)
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Date_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject57
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type TIME and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Time object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject57() throws Fault
	{
		ResultSet rs =null;
		java.util.Date oRetVal=null;
		java.sql.Time brkTimeVal=null;
		String sBrkTimeVal = null ;
		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);

			//to extract the Value of Time to be Updated
			sBrkTimeVal = rsSch.extractVal("Time_Tab",1,sqlp,conn);
			sBrkTimeVal=sBrkTimeVal.substring(sBrkTimeVal.indexOf('\'')+1,sBrkTimeVal.lastIndexOf('\''));

			brkTimeVal = Time.valueOf(sBrkTimeVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Time_In_Null(?)}");
			cstmt.setObject(1,sBrkTimeVal,java.sql.Types.TIME);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Time_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (java.util.Date) rs.getObject(1);
			
			long lDate = oRetVal.getTime();			
			java.sql.Time dbDate = new java.sql.Time(lDate);	
										
			logMsg("Return Value from ctssql.stmt :" +brkTimeVal);
			logMsg("Return Value from table :" +dbDate);

			if (dbDate.toString().trim().equals(brkTimeVal.toString().trim()))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Time_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject58
	 * @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 setObject(int parameterIndex, Object x,int jdbcType) method
	 *                    sets the value of the designated parameter using the given object.
	 *                    The second parameter must be of type Object; therefore, the
	 *                    java.lang equivalent objects should be used for built-in types.
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (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(int parameterIndex, Object x,int jdbcType) method to set
	 *                    String object for SQL Type TIMESTAMP and call
	 *                    statement.executeQuery(String sql) method and call
	 *                    ResultSet.getObject(int column). It should return a Timestamp object
	 *                    that is been set. Compare the result with the extracted
	 *                    value from the ctssql.stmt file.  Both the values should be equal.
	 *
	 */
	public void testSetObject58() throws Fault
	{
		ResultSet rs =null;
		java.sql.Timestamp oRetVal=null;
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal = null ;
		try
		{
			rsSch.createTab("Timestamp_Tab",sqlp,conn);

			// to convert String value into java.sql.Timestamp value
			sInTimeVal = rsSch.extractVal("Timestamp_Tab",1,sqlp,conn);
			sInTimeVal=sInTimeVal.substring(sInTimeVal.indexOf('\'')+1,sInTimeVal.lastIndexOf('\''));
			inTimeVal=Timestamp.valueOf(sInTimeVal);
			logMsg("Timestamp value to be updated   :   " + inTimeVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Timestamp_In_Null(?)}");
			cstmt.setObject(1,sInTimeVal,java.sql.Types.TIMESTAMP);

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Timestamp_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			oRetVal = (java.sql.Timestamp) rs.getObject(1);
			logMsg("Return Value from ctssql.stmt :" +inTimeVal);
			logMsg("Return Value from table :" +oRetVal);

			if (oRetVal.equals(inTimeVal))
			{
				logMsg("setObject method sets the designated parameter with the object");
			}
			else
			{
				logErr("setObject method does not set the designated parameter with the object");
				throw new Fault ("Call to setObject method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject method is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject method is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Timestamp_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testSetObject59
	 * @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 setObject(int parameterIndex, Object x,int targetSqlType)
	 *                    method sets the value of the designated parameter using the
	 *                    given object. The second parameter must be of type Object;
	 *                    therefore, the java.lang equivalent objects should be used
	 *                    for built-in types.
	 *
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database.
	 *                    Using the IN parameter of that object,update the column Min_Val
	 *                    of the Tinyint_Tab with the maximum value of the Tinyint_Tab.
	 *                    Execute a query to retrieve the Min_Val from Tinyint_Tab. Compare
	 *                    the returned value with the maximum value extracted from ctssql.stmt
	 *                    file. Both of them should be equal
	 */
	public void testSetObject59() throws Fault
	{
		ResultSet rs = null;
		Integer maxTinyintVal = null ;
		BigDecimal maxBigDecimalVal=null;
		String sTinyintVal=null;
		String smaxStringVal=null;
		try
		{

			rsSch.createTab("Tinyint_Tab",sqlp,conn);
			//get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_In_Min(?)}");

			//to extract the Maximum Value of Tinyint to be Updated
			smaxStringVal = rsSch.extractVal("Tinyint_Tab",1,sqlp,conn);
			maxBigDecimalVal = new BigDecimal(smaxStringVal);
			maxTinyintVal = new Integer(smaxStringVal);
			logMsg("Maximum Tinyint Value :" + maxTinyintVal);

			//setting the value
			cstmt.setObject(1,maxBigDecimalVal,java.sql.Types.TINYINT);
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.executeUpdate
			String Min_Val_Query=sqlp.getProperty("Tinyint_Query_Min","");
			logMsg(Min_Val_Query);
			rs=stmt.executeQuery(Min_Val_Query);
			rs.next();

			sTinyintVal=""+ rs.getObject(1);
			logMsg("Returned Tinyint Value after Updation:" + sTinyintVal);
			logMsg("Returned Tinyint Value from ctssql.stmt:" + maxTinyintVal);

			if (sTinyintVal.trim().equals(smaxStringVal.trim()))
			{
				logMsg("setObject Method sets the designated parameter with the Object");
			}
			else
			{
				logErr("setObject Method does not set the designated parameter with the Object");
				throw new Fault("Call to setObject Method is Failed!");
			}

		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +e);
			}
		}
	}


	/*
	 * @testName:         testSetObject60
	 * @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 setObject(int parameterIndex, Object x,int targetSqlType)
	 *                    method sets the value of the designated parameter using the
	 *                    given object. The second parameter must be of type Object;
	 *                    therefore, the java.lang equivalent objects should be used
	 *                    for built-in types.
	 *
	 *                    The JDBC specification specifies a standard mapping from Java
	 *                    Object types to SQL types. The given argument will be converted
	 *                    to the corresponding SQL type before being sent to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,update the column Null_Val
	 *                    of the Tinyint_Tab with the minimum value of the Tinyint_Tab.
	 *                    Execute a query to retrieve the Null_Val from Tinyint_Tab. Compare
	 *                    the returned value with the minimum value extracted from ctssql.stmt
	 *                    file,Both of them should be equal
	 */
	public void testSetObject60() throws Fault
	{
		ResultSet rs = null;
		Integer minTinyintVal = null ;
		BigDecimal minBigDecimalVal=null;
		String sTinyintVal=null;
		String sminStringVal=null;
		try
		{

			// to create the String Table
			rsSch.createTab("Tinyint_Tab",sqlp,conn);
			//get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_In_Null(?)}");

			//to extract the Maximum Value of Tinyint to be Updated
			sminStringVal = rsSch.extractVal("Tinyint_Tab",2,sqlp,conn);
			minBigDecimalVal=new BigDecimal(sminStringVal);
			minTinyintVal = new Integer(sminStringVal);
			logMsg("Minimum Tinyint Value :" + minTinyintVal);

			//setting the value
			cstmt.setObject(1,minBigDecimalVal,java.sql.Types.TINYINT);
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.executeUpdate
			String Null_Val_Query=sqlp.getProperty("Tinyint_Query_Null","");
			logMsg("Query String :" +Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();

			sTinyintVal= ""+ rs.getObject(1);
			logMsg("Returned Tinyint Value after Updation:" + sTinyintVal);
			logMsg("Returned Tinyint Value after Updation:" + minTinyintVal);

			if (sTinyintVal.trim().equals(sminStringVal.trim()))
			{
				logMsg("setObject Method sets the designated parameter with the Object");
			}
			else
			{
				logErr("setObject Method does not set the designated parameter with the Object");
				throw new Fault("Call to setObject Method is Failed!");
			}

		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setObject is Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +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");
		}
	}
}
