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

/*
 * %W% %E%
 */

package com.sun.cts.tests.jdbc.ee.prepStmt.prepStmt6;

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 prepStmtClient6 class tests methods of PreparedStatement interface using 
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.8, 11/24/00
 */

public class prepStmtClient6 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.prepStmt.prepStmt6";

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

	//Harness requirements 
	private transient Connection conn = null;
	private ResultSet rs = null;
	private Statement stmt = null;
	private transient DatabaseMetaData dbmd = null;
	private DataSource ds1 = null;
	private dbSchema dbSch = null;
	private rsSchema rsSch = null;
	private csSchema csSch = null;
	private String drManager = null;
	private Properties sqlp = null;
	private Properties props = null;
	private PreparedStatement pstmt = null;

	/* Run test in standalone mode */
	public static void main(String[] args)
	{
		prepStmtClient6 theTests = new prepStmtClient6();
		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 = new Properties();
				String sqlStmt = p.getProperty("rsQuery","");
				InputStream istr = new FileInputStream(sqlStmt);
				sqlp.load(istr);*/
				sqlp = p;
				props = 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();
				dbmd = conn.getMetaData();
				rsSch = new rsSchema();
				csSch = new csSchema();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception: " + ex.getMessage());
			}
		} 
		catch(Exception e)
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}



	/*
	 * @testName:         testSetObject43
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the minimum value of Double_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the minimum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject43() throws Fault 
	{
		Double minDoubleVal = null ;
		String minStringVal = null;
		Double rDoubleVal = null;
		String sminStringVal = null;

		try
		{
			//to create the Double Table
			rsSch.createTab("Double_Tab",sqlp,conn);

			//to update Null value column with Minimum value 
			String sPrepStmt = sqlp.getProperty("Double_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Double to be Updated 
			sminStringVal = rsSch.extractVal("Double_Tab",2,sqlp,conn);

			minStringVal = new String(sminStringVal);
			minDoubleVal = new Double(sminStringVal);
			logMsg("Minimum Double Value to be updated: " + minDoubleVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,minStringVal,java.sql.Types.DOUBLE);
			pstmt.executeUpdate();

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

			rDoubleVal = (Double) rs.getObject(1);
			logMsg("Returned Double Value after Updation: " + rDoubleVal);
			logMsg("Value returned from ctssql.stmt: " + minDoubleVal);

			if(rDoubleVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Double_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject44
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *                    
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Min_Val with the maximum value of Decimal_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject44() throws Fault 
	{

		BigDecimal maxDecimalVal = null ;
		String maxStringVal = null;
		BigDecimal rDecimalVal = null;
		String smaxStringVal = null;

		try
		{
			//to create the Decimal Table
			rsSch.createTab("Decimal_Tab",sqlp,conn);

			//to update Minimum value column with Maximum value 
			String sPrepStmt = sqlp.getProperty("Decimal_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Decimal to be Updated 
			smaxStringVal = rsSch.extractVal("Decimal_Tab",1,sqlp,conn);

			maxStringVal = new String(smaxStringVal);
			maxDecimalVal = new BigDecimal(smaxStringVal);
			logMsg("Maximum Decimal Value to be updated: " + maxDecimalVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.DECIMAL,15);
			pstmt.executeUpdate();

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

			rDecimalVal = (BigDecimal) rs.getObject(1);
			logMsg("Returned Decimal Value after Updation: " + rDecimalVal);
			logMsg("Value returned from ctssql.stmt: " + maxDecimalVal);

			if(rDecimalVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject45
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *                    
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the minimum value of Decimal_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the minimum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject45() throws Fault 
	{
		BigDecimal minDecimalVal = null ;
		String minStringVal = null;
		BigDecimal rDecimalVal = null;
		String sminStringVal = null;

		try
		{
			//to create the Decimal Table
			rsSch.createTab("Decimal_Tab",sqlp,conn);

			//to update Null value column with Minimum value 
			String sPrepStmt = sqlp.getProperty("Decimal_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Decimal to be Updated 
			sminStringVal = rsSch.extractVal("Decimal_Tab",2,sqlp,conn);

			minStringVal = new String(sminStringVal);
			minDecimalVal = new BigDecimal(sminStringVal);
			logMsg("Minimum Decimal Value to be updated: " + minDecimalVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,minStringVal,java.sql.Types.DECIMAL,15);
			pstmt.executeUpdate();

			//to query from the database to check the call of pstmt.executeUpdate
			//to get the query string
			String Null_Val_Query = sqlp.getProperty("Decimal_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rDecimalVal = (BigDecimal)rs.getObject(1);
			logMsg("Returned Decimal Value after Updation: " + rDecimalVal);
			logMsg("Value returned from ctssql.stmt: " + minDecimalVal);

			if(rDecimalVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject46
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Numeric_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject46() throws Fault 
	{
		BigDecimal maxNumericVal = null ;
		String maxStringVal = null;
		BigDecimal rNumericVal = null;
		String smaxStringVal = null;

		try
		{
			//to create the Numeric Table
			rsSch.createTab("Numeric_Tab",sqlp,conn);

			//to update Minimum value column with Maximum value 
			String sPrepStmt = sqlp.getProperty("Numeric_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Numeric to be Updated 
			smaxStringVal = rsSch.extractVal("Numeric_Tab",1,sqlp,conn);
			
			maxStringVal = new String(smaxStringVal);
			maxNumericVal = new BigDecimal(smaxStringVal);
			logMsg("Maximum Numeric Value to be updated: " + maxNumericVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.NUMERIC,15);
			pstmt.executeUpdate();

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

			rNumericVal = (BigDecimal) rs.getObject(1);
			logMsg("Returned Numeric Value after Updation: " + rNumericVal);
			logMsg("Value returned from ctssql.stmt: " + maxNumericVal);

			if(rNumericVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject47
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the minimum value of Numeric_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the minimum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject47() throws Fault 
	{
		
		BigDecimal minNumericVal = null;
		String minStringVal = null;
		BigDecimal rNumericVal = null;
		String sminStringVal = null;

		try
		{
			//to create the Numeric Table
			rsSch.createTab("Numeric_Tab",sqlp,conn);

			//to update Null value column with Minimum value 
			String sPrepStmt = sqlp.getProperty("Numeric_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Numeric to be Updated 
			sminStringVal = rsSch.extractVal("Numeric_Tab",2,sqlp,conn);
			
			minStringVal = new String(sminStringVal);
			minNumericVal = new BigDecimal(sminStringVal);
			logMsg("Minimum Numeric Value to be updated: " + minNumericVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,minStringVal,java.sql.Types.NUMERIC,15);
			pstmt.executeUpdate();

			//to query from the database to check the call of pstmt.executeUpdate
			//to get the query string
			String Null_Val_Query = sqlp.getProperty("Numeric_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rNumericVal = (BigDecimal) rs.getObject(1);
			logMsg("Returned Numeric Value after Updation: " + rNumericVal);
			logMsg("Value returned from ctssql.stmt: " + minNumericVal);

			if(rNumericVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject48
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Min_Val with the maximum value of Bit_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject48() throws Fault 
	{
		Boolean maxBooleanVal = null;
		Boolean rBooleanVal = null;
		String  smaxBooleanVal = null;
		String  maxStringVal = null;
		boolean booleanVal;

		try
		{
			//to create the Bit Table
			rsSch.createTab("Bit_Tab",sqlp,conn);

			//to update Minimum (false) value column with maximum (true)
			String sPrepStmt = sqlp.getProperty("Bit_Tab_Min_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Boolean to be Updated 
			smaxBooleanVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);

			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				logMsg("database supports Boolean datatype.");
				maxBooleanVal = new Boolean(smaxBooleanVal);
			}
			else
			{
				logMsg("smaxBooleanVal =" +smaxBooleanVal);
				booleanVal= (smaxBooleanVal.trim().equals("1"))? true : false;
				logMsg("BooleanVal =" +booleanVal);
				maxBooleanVal = new Boolean(booleanVal);
			}
			logMsg("Maximum Boolean Value :" + maxBooleanVal);
			maxStringVal = maxBooleanVal.toString();
			
			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxBooleanVal,java.sql.Types.BIT);
			pstmt.executeUpdate();

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

			Object orBooleanVal = rs.getObject(1);
			
			rBooleanVal = new Boolean(orBooleanVal.toString());
			
			logMsg("Returned Boolean Value after Updation: " + rBooleanVal);
			logMsg("Value returned from ctssql.stmt: " + maxBooleanVal);

			if(rBooleanVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject49
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the minimum value of Bit_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the minimum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject49() throws Fault 
	{
		Boolean minBooleanVal = null;
		Boolean rBooleanVal = null;
		String  sminBooleanVal = null;
		String  minStringVal = null;
		boolean booleanVal;

		try
		{
			//to create the Bit Table
			rsSch.createTab("Bit_Tab",sqlp,conn);

			//to update Null value column with Minimum value 
			String sPrepStmt = sqlp.getProperty("Bit_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Boolean to be Updated 
			sminBooleanVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);

			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				logMsg("database supports Boolean datatype.");
				minBooleanVal = new Boolean(sminBooleanVal);
			}
			else
			{
				logMsg("Minimum Boolean Value :" + sminBooleanVal);
				booleanVal= (sminBooleanVal.trim().equals("1"))? true : false;
				minBooleanVal = new Boolean(booleanVal);
			}
			logMsg("Minimum Boolean Value :" + minBooleanVal);
			minStringVal = minBooleanVal.toString();

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,minBooleanVal,java.sql.Types.BIT);
			pstmt.executeUpdate();

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

			Object orBooleanVal =  rs.getObject(1);
			
			rBooleanVal = new Boolean(orBooleanVal.toString());
			
			logMsg("Returned Boolean Value after Updation: " + rBooleanVal);
			logMsg("Value returned from ctssql.stmt: " + minBooleanVal);

			if(rBooleanVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject50
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Char_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject50() throws Fault
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			//to create the Char table
			rsSch.createTab("Char_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			//get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.CHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject51
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Char_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject51() throws Fault
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			// to create the Char table
			rsSch.createTab("Char_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Char_Tab",2,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.CHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject52
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Varchar_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject52() throws Fault 
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			// to create the Varchar table
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Varchar_Tab",1,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.VARCHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject53
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Varchar_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject53() throws Fault
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			// to create the Varchar table
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Varchar_Tab",2,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.VARCHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject54
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Longvarchar_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject54() throws Fault
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			// to create the Longvarchar table
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Longvarcharnull_Tab",1,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.LONGVARCHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject55
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the maximum value of Longvarchar_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject55() throws Fault 
	{
		String maxStringVal = null;
		String rStringVal = null;

		try
		{
			// to create the Longvarchar table
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

			//to extract the Value of String to be Updated 
			maxStringVal = rsSch.extractVal("Longvarcharnull_Tab",1,sqlp,conn);
			maxStringVal = maxStringVal.substring(1,maxStringVal.length()-1);
			logMsg("String Value: " + maxStringVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxStringVal,java.sql.Types.LONGVARCHAR);
			pstmt.executeUpdate();

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

			rStringVal = rs.getObject(1).toString();
			rStringVal = rStringVal.trim();
			maxStringVal = maxStringVal.trim();
			logMsg("Returned String Value after Updation: " + rStringVal);
			logMsg("Value returned from ctssql.stmt: " + maxStringVal);

			if(rStringVal.equals(maxStringVal))
			{
				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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject56
	 * @assertion:        A Prepared Statement object provides a way of calling
	 *                    precompiled SQL statements.It can take one or more parameters
	 *                    as input arguments(IN parameters). (See section 11.1.6 of
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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.
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the
	 *                    database.Update the column value of the Binary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method. Call the getObject(int parameterIndex) method.to retrieve
	 *                    the byte array. It should return the byte array object that has been set.
	 */

	public void testSetObject56() throws Fault
	{
		byte retByteArr[] = null;
		String binarySize = null;
		
		try
		{
			rsSch.createTab("Binary_Tab",sqlp,conn);
			// to extract the Binary Table size from property file
			binarySize = props.getProperty("binarySize");
			logMsg("Binary Table Size : " + 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.setObject(1,bytearr,java.sql.Types.BINARY);
			pstmt.executeUpdate();

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

			retByteArr = (byte[]) rs.getObject(1);
			
			for(int i=0;i<bytearrsize;i++)
			{
				if(retByteArr[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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Binary_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject57
	 * @assertion:        A Prepared Statement object provides a way of calling
	 *                    precompiled SQL statements.It can take one or more parameters
	 *                    as input arguments(IN parameters). (See section 11.1.6 of
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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.
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the
	 *                    database.Update the column value of the Varbinary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method. Call the getObject(int parameterIndex) method.to retrieve
	 *                    the byte array. It should return the byte array object that has been set.
	 */

	public void testSetObject57() throws Fault
	{
		byte retByteArr[] = null;
		String varbinarySize = null;
		

		try
		{
			rsSch.createTab("Varbinary_Tab",sqlp,conn);
			// to extract the Varbinary Table size from property file
			varbinarySize = props.getProperty("varbinarySize");
			logMsg("Varbinary Table Size : " + varbinarySize);

			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.setObject(1,bytearr,java.sql.Types.VARBINARY);
			pstmt.executeUpdate();

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

			retByteArr = (byte[]) rs.getObject(1);

			for(int i=0;i<bytearrsize;i++)
			{
				if(retByteArr[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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Varbinary_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject58
	 * @assertion:        A Prepared Statement object provides a way of calling
	 *                    precompiled SQL statements.It can take one or more parameters
	 *                    as input arguments(IN parameters). (See section 11.1.6 of
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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.
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the
	 *                    database.Update the column value of the Longvarbinary_Tab with a
	 *                    byte array using the PreparedStatement.setBytes(int columnIndex)
	 *                    method. Call the getObject(int parameterIndex) method.to retrieve
	 *                    the byte array. It should return the byte array object that has been set.
	 */

	public void testSetObject58() throws Fault
	{
		byte retByteArr[] = null;
		try
		{
			rsSch.createTab("Longvarbinary_Tab",sqlp,conn);
			String sPrepStmt = sqlp.getProperty("Longvarbinary_Tab_Val_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			// to get the byte array value to be updated 
			String binsize = props.getProperty("longvarbinarySize");
			int bytearrsize = Integer.parseInt(binsize);
			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.setObject(1,bytearr,java.sql.Types.LONGVARBINARY);
			pstmt.executeUpdate();

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

			retByteArr = (byte[]) rs.getObject(1);
			
			for(int i=0;i<bytearrsize;i++)
			{
				if(retByteArr[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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Longvarbinary_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject59
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the Non Null value of Date_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the Non Null value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject59() throws Fault
	{
		java.sql.Date mfgDateVal = null;
		String mfgStringVal = null;
		String sMfgStringVal = null;
		java.sql.Date rDateVal = null;

		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);
			String sPrepStmt = sqlp.getProperty("Date_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Value of Date to be Updated 
			sMfgStringVal = rsSch.extractVal("Date_Tab",1,sqlp,conn);
			sMfgStringVal = sMfgStringVal.substring(sMfgStringVal.indexOf('\'')+1,sMfgStringVal.lastIndexOf('\''));
			logMsg("Date Value: " + sMfgStringVal);

			// to convert String value into java.sql.Date value
			mfgDateVal = java.sql.Date.valueOf(sMfgStringVal);
			logMsg("Date value to be updated: "+ mfgDateVal);

			mfgStringVal = sMfgStringVal;

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,mfgStringVal,java.sql.Types.DATE);
			pstmt.executeUpdate();

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

			java.util.Date urDateVal = (java.util.Date) rs.getObject(1);
			long ld=urDateVal.getTime();
			
			rDateVal = new java.sql.Date(ld);
			
			logMsg("Returned Date Value after Updation:" + rDateVal);
			logMsg("Value returned from ctssql.stmt: " + mfgDateVal);

			if(rDateVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Date_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject60
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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.
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the Non Null value of Time_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the Non Null value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method.
	 *                    Both the values should be equal.
	 */

	public void testSetObject60() throws Fault
	{
		java.sql.Time brkTimeVal = null;
		String brkStringVal = null ;
		String sBrkTimeVal = null;
		java.sql.Time rTimeVal = null;

		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);
			String sPrepStmt = sqlp.getProperty("Time_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//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('\''));
			logMsg("Time Value  to be updated  :" + sBrkTimeVal);

			// to convert String value into java.sql.Time value
			brkTimeVal = Time.valueOf(sBrkTimeVal);
			brkStringVal = new String(sBrkTimeVal) ;

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,brkStringVal,java.sql.Types.TIME);
			pstmt.executeUpdate();

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

			java.util.Date urTimeVal = (java.util.Date) rs.getObject(1);
			long lt=urTimeVal.getTime();
			
			rTimeVal = new java.sql.Time(lt);
			
			logMsg("Returned Time Value after Updation: " + rTimeVal);
			logMsg("Value returned from ctssql.stmt: " + brkTimeVal);

			if(rTimeVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Time_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject61
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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.
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Null_Val with the Non Null value of Timestamp_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the Non Null value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject61() throws Fault
	{
		java.sql.Timestamp inTimeVal = null;
		String sInTimeVal = null;
		String inStringVal = null ;
		java.sql.Timestamp rTimestampVal = null;

		try
		{
			// to create the Timestamp table
			rsSch.createTab("Timestamp_Tab",sqlp,conn);

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

			//to extract the Value of Timestamp to be Updated 
			sInTimeVal = rsSch.extractVal("Timestamp_Tab",1,sqlp,conn);
			sInTimeVal = sInTimeVal.substring(sInTimeVal.indexOf('\'')+1,sInTimeVal.lastIndexOf('\''));
			logMsg("Timestamp Value: " + sInTimeVal);

			// to convert String value into java.sql.Timestamp
			inStringVal = new String(sInTimeVal);
			inTimeVal = Timestamp.valueOf(sInTimeVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,inStringVal,java.sql.Types.TIMESTAMP);
			pstmt.executeUpdate();

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

			rTimestampVal = (java.sql.Timestamp) rs.getObject(1);
			logMsg("Returned Timestamp Value after Updation: " + rTimestampVal);
			logMsg("Value returned from ctssql.stmt: " + inTimeVal);

			if(rTimestampVal.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 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(pstmt != null)
				{
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Timestamp_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:         testSetObject62
	 * @assertion:        A Prepared Statement object provides a way of calling 
	 *                    precompiled SQL statements.It can take one or more parameters 
	 *                    as input arguments(IN parameters). (See section 11.1.6 of 
	 *                    JDBC 2.0 API Reference & Tutorial,Second Edition)
	 *
	 *                    The drivers must provide full support for Prepared Statement 
	 *                    methods. (See section 6.2.2.3 of Java2 Platform Enterprise 
	 *                    Edition(J2EE) specification v 1.2).
	 *
	 *                    The setObject(int parameterIndex, Object x) 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. 
	 *
	 * @test_Strategy:    Get a PreparedStatement object from the connection to the database.
	 *                    Using the setObject(int parameterIndex, Object x) method,update the 
	 *                    column Min_Val with the maximum value of Tinyint_Tab. Call the 
	 *                    getObject(int columnno) method to retrieve this value. Extract 
	 *                    the maximum value from the ctssql.stmt file. Compare this value 
	 *                    with the value returned by the getObject(int columnno) method. 
	 *                    Both the values should be equal.
	 */

	public void testSetObject62() throws Fault
	{
		Integer maxTinyintVal = null;
		BigDecimal maxBigDecimalVal = null;
		Integer rTinyintVal = null;
		String smaxStringVal = null;

		try
		{
			// to create the Tinyint Table
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

			// to update Minimum value column with maximum 
			String sPrepStmt = sqlp.getProperty("Tinyint_Tab_Min_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//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);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,maxBigDecimalVal,java.sql.Types.TINYINT);
			pstmt.executeUpdate();

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

			Object orTinyintVal =  rs.getObject(1);
			rTinyintVal = new Integer(orTinyintVal.toString());
			
			logMsg("Returned Tinyint Value after Updation: " + rTinyintVal);
			logMsg("Value returned from ctssql.stmt: " + maxTinyintVal);

			if(rTinyintVal.compareTo(maxTinyintVal)==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 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(pstmt != null)
				{	
					 pstmt.close();
					 pstmt = null;
				}
				if(stmt != null)
				{
					 stmt.close();
					 stmt = null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/* cleanup */
	public void  cleanup() throws Fault
	{
		try
		{
			if(pstmt != null)
			{
				pstmt.close();
				pstmt = null;
			}
			if(stmt != null)
			{
				stmt.close();
				stmt = null;
			}
			// close the Database 
			rsSch.dbUnConnect(conn);
			logMsg("Cleanup ok;");
		}
		catch(Exception e)
		{
			logErr("An error occurred while closing the database connection");
		}
	}
}

