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

/*
 * @(#)prepStmtClient13.java	1.7 02/01/12
 */

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

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

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

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

	//Harness requirements 

	private transient Connection conn = null;
	private ResultSet rs = null;
	private Statement stmt = null;
	private PreparedStatement pstmt = 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;
	
	/* Run test in standalone mode */
	public static void main(String[] args) 
	{
		prepStmtClient13 theTests = new prepStmtClient13();
		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:       testSetObject183
	 * @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 of Numeric_Tab 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 testSetObject183() throws Fault
	{
		Float oMinNumericVal = null;
		BigDecimal rNumericVal = null;
		String sminNumericVal = null;
		BigDecimal minNumericVal = null;

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

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

			//to extract the Minimum Value of Double to be Updated in Numeric Table
			sminNumericVal = rsSch.extractVal("Numeric_Tab",2,sqlp,conn);

			oMinNumericVal = new Float(sminNumericVal);
			minNumericVal = new BigDecimal(sminNumericVal);
			logMsg("Minimum Double Value to be updated in Numeric Table: " + oMinNumericVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinNumericVal,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();

			Object orNumericVal =  rs.getObject(1);
			rNumericVal = new BigDecimal(orNumericVal.toString());
			
			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:       testSetObject184
	 * @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 of Bit_Tab with the maximum (true) value of 
	 *                  Bit_Tab. Call the getObject(int columnno) method to retrieve this 
	 *                  value. Extract the maximum (true) 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 testSetObject184() throws Fault
	{
		Float oMaxBooleanVal = null;
		String smaxBooleanVal = null;
		Boolean rBooleanVal = null;
		Boolean maxBooleanVal = null;
		boolean booleanVal;

		try
		{
			// to create the Bit Table
			rsSch.createTab("Bit_Tab",sqlp,conn);
			
			// to update Null value column of Bit table 
			String sPrepStmt = sqlp.getProperty("Bit_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Bit to be Updated in Bit Table
			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);
				if(smaxBooleanVal.equalsIgnoreCase("true"))
				{
					smaxBooleanVal = "1";
				}
				else
				{
					smaxBooleanVal = "0";
				}
			}
			else
			{
				booleanVal = (smaxBooleanVal.trim().equals("1"))? true : false;
				maxBooleanVal = new Boolean(booleanVal);
			}

			oMaxBooleanVal = new Float(smaxBooleanVal);
			logMsg("Maximum Bit Value to be updated :" + oMaxBooleanVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMaxBooleanVal,java.sql.Types.BIT);
			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("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 String 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:       testSetObject185
	 * @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 of Bit_Tab with the minimum (false) value of 
	 *                  Bit_Tab. Call the getObject(int columnno) method to retrieve this 
	 *                  value. Extract the minimum (false) 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 testSetObject185() throws Fault 
	{
		Float oMinBooleanVal = null;
		String sminBooleanVal = null;
		Boolean rBooleanVal = null;
		Boolean minBooleanVal = null;
		boolean booleanVal;

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

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

			//to extract the Minimum Value of Bit 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);
				if(sminBooleanVal.equalsIgnoreCase("true"))
				{
					sminBooleanVal = "1";
				}
				else
				{
					sminBooleanVal = "0";
				}
			}
			else
			{
				booleanVal = (sminBooleanVal.trim().equals("1"))? true : false;
				minBooleanVal = new Boolean(booleanVal);
			}

			oMinBooleanVal = new Float(sminBooleanVal);
			logMsg("Minimum Bit Value to be updated :" + minBooleanVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinBooleanVal,java.sql.Types.BIT);
			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("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:       testSetObject186
	 * @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 of Char_Tab with the maximum value of 
	 *                  Float_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 testSetObject186() throws Fault
	{
		Float oMaxFloatVal = null;
		String smaxFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value column of Char table with maximum value of Double
			String sPrepStmt = sqlp.getProperty("Char_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Float to be Updated in Char Table
			smaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);

			oMaxFloatVal = new Float(smaxFloatVal);
			logMsg("Maximum Float Value to be updated in Char Table: " + smaxFloatVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMaxFloatVal,java.sql.Types.CHAR);
			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("Char_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			rStringVal = rStringVal.trim();
			logMsg("Returned String Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMaxFloatVal);

			if(rFloatVal.equals(oMaxFloatVal))
			{
				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:       testSetObject187
	 * @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 of Char_Tab with the minimum value of 
	 *                  Float_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 testSetObject187() throws Fault
	{
		Float oMinFloatVal = null;
		String sminFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value column with minimum value of Float
			String sPrepStmt = sqlp.getProperty("Char_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Float to be Updated in Char Table
			sminFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);

			oMinFloatVal = new Float(sminFloatVal);
			logMsg("Minimum Float Value to be updated in Char Table: " + oMinFloatVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinFloatVal,java.sql.Types.CHAR);
			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("Char_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			logMsg("Returned Float Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMinFloatVal);

			if(rFloatVal.equals(oMinFloatVal))
			{
				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:       testSetObject188
	 * @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 of Varchar_Tab with the maximum value of 
	 *                  Float_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 testSetObject188() throws Fault
	{
		Float oMaxFloatVal = null;
		String smaxFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value column of Varchar table with maximum value of Float
			String sPrepStmt = sqlp.getProperty("Varchar_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Float to be Updated in Varchar Table
			smaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);

			oMaxFloatVal = new Float(smaxFloatVal);
			logMsg("Maximum Float Value to be updated in Varchar Table: " + smaxFloatVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMaxFloatVal,java.sql.Types.VARCHAR);
			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("Varchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			rStringVal = rStringVal.trim();
			logMsg("Returned String Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMaxFloatVal);

			if(rFloatVal.equals(oMaxFloatVal))
			{
				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:       testSetObject189
	 * @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 of Varchar_Tab with the minimum value of 
	 *                  Float_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 testSetObject189() throws Fault
	{
		Float oMinFloatVal = null;
		String sminFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value column of Varchar table with minimum value of Float
			String sPrepStmt = sqlp.getProperty("Varchar_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Float to be Updated in Varchar Table
			sminFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);

			oMinFloatVal = new Float(sminFloatVal);
			logMsg("Minimum Float Value to be updated in Varchar Table: " + oMinFloatVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinFloatVal,java.sql.Types.VARCHAR);
			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("Varchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			logMsg("Returned Float Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMinFloatVal);

			if(rFloatVal.equals(oMinFloatVal))
			{
				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:       testSetObject190
	 * @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 of Longvarchar_Tab with the maximum value of 
	 *                  Float_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 testSetObject190() throws Fault
	{
		Float oMaxFloatVal = null;
		String smaxFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value column of Longvarchar table with maximum value of Float
			String sPrepStmt = sqlp.getProperty("Longvarchar_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Maximum Value of Float to be Updated in Longvarchar Table
			smaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);

			oMaxFloatVal = new Float(smaxFloatVal);
			logMsg("Maximum Float Value to be updated in Longvarchar Table: " + smaxFloatVal);

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMaxFloatVal,java.sql.Types.LONGVARCHAR);
			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("Longvarchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			rStringVal = rStringVal.trim();
			logMsg("Returned String Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMaxFloatVal);

			if(rFloatVal.equals(oMaxFloatVal))
			{
				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:       testSetObject191
	 * @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 of Longvarchar_Tab with the minimum value of 
	 *                  Float_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 testSetObject191() throws Fault
	{
		Float oMinFloatVal = null;
		String sminFloatVal = null;
		String rStringVal = null;
		Float rFloatVal = null;

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

			// to update Null value of Longvarchar column with minimum value of Float
			String sPrepStmt = sqlp.getProperty("Longvarchar_Tab_Null_Update","");
			logMsg("Prepared Statement String: " + sPrepStmt);

			//to extract the Minimum Value of Float to be Updated in Longvarchar Table
			sminFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);

			oMinFloatVal = new Float(sminFloatVal);
			logMsg("Minimum Float Value to be updated in Longvarchar Table: " + oMinFloatVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinFloatVal,java.sql.Types.LONGVARCHAR);
			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("Longvarchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			rStringVal = (String) rs.getObject(1);
			rFloatVal = new Float(rStringVal);
			logMsg("Returned Float Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + oMinFloatVal);

			if(rFloatVal.equals(oMinFloatVal))
			{
				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:       testSetObject192
	 * @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 of Tinyint_Tab 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 testSetObject192() throws Fault
	{
		Double oMaxTinyintVal = null;
		Integer rTinyintVal = null;
		String smaxTinyintVal = null;
		Integer maxTinyintVal = 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 
			smaxTinyintVal = rsSch.extractVal("Tinyint_Tab",1,sqlp,conn);

			oMaxTinyintVal = new Double(smaxTinyintVal);
			maxTinyintVal = new Integer(smaxTinyintVal);
			logMsg("Maximum Tinyint Value: " + oMaxTinyintVal.toString());

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

			//to query from the database to check the call of pstmt.executeUpdate
			//to get the query string
			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.equals(maxTinyintVal))
			{
				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){ }
		}
	}



	/*
	 * @testName:       testSetObject193
	 * @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 of Tinyint_Tab with the minimum value of 
	 *                  Tinyint_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 testSetObject193() throws Fault
	{
		Double oMinTinyintVal = null;
		Integer rTinyintVal = null;
		String sminTinyintVal = null;
		Integer minTinyintVal = null;

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

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

			//to extract the Minimum Value of Tinyint to be Updated 
			sminTinyintVal = rsSch.extractVal("Tinyint_Tab",2,sqlp,conn);

			oMinTinyintVal = new Double(sminTinyintVal);
			minTinyintVal = new Integer(sminTinyintVal);
			logMsg("Minimum Tinyint Value: " + oMinTinyintVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinTinyintVal,java.sql.Types.TINYINT);
			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("Tinyint_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_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: " + minTinyintVal);

			if(rTinyintVal.equals(minTinyintVal))
			{
				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){ }
		}
	}



	/*
	 * @testName:       testSetObject194
	 * @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 of Smallint_Tab with the maximum value of 
	 *                  Smallint_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 testSetObject194() throws Fault
	{
		Double oMaxSmallintVal = null;
		Integer rSmallintVal = null;
		String smaxSmallintVal = null;
		Integer maxSmallintVal = null;

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

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

			//to extract the Maximum Value of Smallint to be Updated 
			smaxSmallintVal = rsSch.extractVal("Smallint_Tab",1,sqlp,conn);

			oMaxSmallintVal = new Double(smaxSmallintVal);
			maxSmallintVal = new Integer(smaxSmallintVal);
			logMsg("Maximum Smallint Value: " + oMaxSmallintVal.toString());

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

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

			Object orSmallintVal =  rs.getObject(1);
			rSmallintVal = new Integer(orSmallintVal.toString());
			
			logMsg("Returned Smallint Value after Updation: " + rSmallintVal);
			logMsg("Value returned from ctssql.stmt: " + maxSmallintVal);

			if(rSmallintVal.equals(maxSmallintVal))
			{
				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("Smallint_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject195
	 * @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 of Smallint_Tab with the minimum value of 
	 *                  Smallint_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 testSetObject195() throws Fault
	{
		Double oMinSmallintVal = null;
		Integer rSmallintVal = null;
		String sminSmallintVal = null;
		Integer minSmallintVal = null;

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

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

			//to extract the Minimum Value of Smallint to be Updated 
			sminSmallintVal = rsSch.extractVal("Smallint_Tab",2,sqlp,conn);

			oMinSmallintVal = new Double(sminSmallintVal);
			minSmallintVal = new Integer(sminSmallintVal);
			logMsg("Minimum Smallint Value: " + oMinSmallintVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinSmallintVal,java.sql.Types.SMALLINT);
			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("Smallint_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			Object orSmallintVal = rs.getObject(1);
			rSmallintVal = new Integer(orSmallintVal.toString());
		
			logMsg("Returned Smallint Value after Updation: " + rSmallintVal);
			logMsg("Value returned from ctssql.stmt: " + minSmallintVal);

			if(rSmallintVal.equals(minSmallintVal))
			{
				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("Smallint_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject196
	 * @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 of Integer_Tab with the maximum value of 
	 *                  Integer_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 testSetObject196() throws Fault
	{
		Double oMaxIntegerVal = null;
		Integer rIntegerVal = null;
		String smaxIntegerVal = null;
		Integer maxIntegerVal = null;

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

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

			//to extract the Maximum Value of Integer to be Updated 
			smaxIntegerVal = rsSch.extractVal("Integer_Tab",1,sqlp,conn);

			oMaxIntegerVal = new Double(smaxIntegerVal);
			maxIntegerVal = new Integer(smaxIntegerVal);
			logMsg("Maximum Integer Value: " + oMaxIntegerVal.toString());

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

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

			Object orIntegerVal = rs.getObject(1);
			rIntegerVal = new Integer(orIntegerVal.toString());
			
			logMsg("Returned Integer Value after Updation: " + rIntegerVal);
			logMsg("Value returned from ctssql.stmt: " + maxIntegerVal);

			if(rIntegerVal.equals(maxIntegerVal))
			{
				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("Integer_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject197
	 * @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 of Integer_Tab with the minimum value of 
	 *                  Integer_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 testSetObject197() throws Fault
	{
		Double oMinIntegerVal = null;
		Integer rIntegerVal = null;
		String sminIntegerVal = null;
		Integer minIntegerVal = null;

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

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

			//to extract the Minimum Value of Integer to be Updated 
			sminIntegerVal = rsSch.extractVal("Integer_Tab",2,sqlp,conn);

			oMinIntegerVal = new Double(sminIntegerVal);
			minIntegerVal = new Integer(sminIntegerVal);
			logMsg("Minimum Integer Value: " + oMinIntegerVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinIntegerVal,java.sql.Types.INTEGER);
			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("Integer_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			Object orIntegerVal =  rs.getObject(1);
			rIntegerVal = new Integer(orIntegerVal.toString());
			
			logMsg("Returned Integer Value after Updation: " + rIntegerVal);
			logMsg("Value returned from ctssql.stmt: " + minIntegerVal);

			if(rIntegerVal.equals(minIntegerVal))
			{
				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("Integer_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject198
	 * @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 of Bigint_Tab with the maximum value of 
	 *                  Bigint_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 testSetObject198() throws Fault
	{
		Double oMaxBigintVal = null;
		Long rBigintVal = null;
		String smaxBigintVal = null;
		Long maxBigintVal = null;

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

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

			//to extract the Maximum Value of Long to be Updated 
			smaxBigintVal = rsSch.extractVal("Bigint_Tab",1,sqlp,conn);

			oMaxBigintVal = new Double(smaxBigintVal);
			maxBigintVal = new Long(smaxBigintVal);
			logMsg("Maximum Long Value: " + oMaxBigintVal.toString());

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

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

			Object orBigintVal =  rs.getObject(1);
			rBigintVal = new Long(orBigintVal.toString());
			
			logMsg("Returned Long Value after Updation: " + rBigintVal);
			logMsg("Value returned from ctssql.stmt: " + maxBigintVal);

			if(rBigintVal.equals(maxBigintVal))
			{
				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("Bigint_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject199
	 * @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 of Bigint_Tab with the minimum value of 
	 *                  Bigint_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 testSetObject199() throws Fault
	{
		Double oMinBigintVal = null;
		Long rBigintVal = null;
		String sminBigintVal = null;
		Long minBigintVal = null;

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

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

			//to extract the Minimum Value of Long to be Updated 
			sminBigintVal = rsSch.extractVal("Bigint_Tab",2,sqlp,conn);

			oMinBigintVal = new Double(sminBigintVal);
			minBigintVal = new Long(sminBigintVal);
			logMsg("Minimum Long Value: " + oMinBigintVal.toString());

			// get the PreparedStatement object
			PreparedStatement pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinBigintVal,java.sql.Types.BIGINT);
			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("Bigint_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			Object orBigintVal =  rs.getObject(1);
			rBigintVal = new Long(orBigintVal.toString());
			
			logMsg("Returned Long Value after Updation: " + rBigintVal);
			logMsg("Value returned from ctssql.stmt: " + minBigintVal);

			if(rBigintVal.equals(minBigintVal))
			{
				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("Bigint_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject200
	 * @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 of Real_Tab with the maximum value of 
	 *                  Real_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 testSetObject200() throws Fault
	{
		Double oMaxRealVal = null;
		Float rRealVal = null;
		String smaxRealVal = null;
		Float maxRealVal = null;

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

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

			//to extract the Maximum Value of Float to be Updated 
			smaxRealVal = rsSch.extractVal("Real_Tab",1,sqlp,conn);

			oMaxRealVal = new Double(smaxRealVal);
			maxRealVal = new Float(smaxRealVal);
			logMsg("Maximum Long Value: " + oMaxRealVal.toString());

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

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

			Object orRealVal =  rs.getObject(1);
			rRealVal = new Float(orRealVal.toString());
			
			logMsg("Returned Float Value after Updation: " + rRealVal);
			logMsg("Value returned from ctssql.stmt: " + maxRealVal);

			if(rRealVal.equals(maxRealVal))
			{
				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("Real_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject201
	 * @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 of Real_Tab with the minimum value of 
	 *                  Real_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 testSetObject201() throws Fault
	{
		Double oMinRealVal = null;
		Float rRealVal = null;
		String sminRealVal = null;
		Float minRealVal = null;

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

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

			//to extract the Minimum Value of Long to be Updated 
			sminRealVal = rsSch.extractVal("Real_Tab",2,sqlp,conn);

			oMinRealVal = new Double(sminRealVal);
			minRealVal = new Float(sminRealVal);
			logMsg("Minimum Long Value: " + oMinRealVal.toString());

			// get the PreparedStatement object
			pstmt = conn.prepareStatement(sPrepStmt);
			pstmt.setObject(1,oMinRealVal,java.sql.Types.REAL);
			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("Real_Query_Null","");
			logMsg(Null_Val_Query);
			rs = stmt.executeQuery(Null_Val_Query);
			rs.next();

			Object orRealVal =  rs.getObject(1);
			rRealVal = new Float(orRealVal.toString());
			
			logMsg("Returned Float Value after Updation: " + rRealVal);
			logMsg("Value returned from ctssql.stmt: " + minRealVal);

			if(rRealVal.equals(minRealVal))
			{
				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("Real_Tab",conn);
			}
			catch(Exception e){ }
		}
	}



	/*
	 * @testName:       testSetObject202
	 * @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 of Float_Tab with the maximum value of 
	 *                  Float_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 testSetObject202() throws Fault
	{
		Double oMaxFloatVal = null;
		Double rFloatVal = null;
		String smaxFloatVal = null;
		Double maxFloatVal = null;

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

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

			//to extract the Maximum Value of Float to be Updated 
			smaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);

			oMaxFloatVal = new Double(smaxFloatVal);
			maxFloatVal = new Double(smaxFloatVal);
			logMsg("Maximum Float Value: " + oMaxFloatVal.toString());

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

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

			Object orFloatVal =  rs.getObject(1);
			rFloatVal = new Double(orFloatVal.toString());
			
			logMsg("Returned Float Value after Updation: " + rFloatVal);
			logMsg("Value returned from ctssql.stmt: " + maxFloatVal);

			if(rFloatVal.equals(maxFloatVal))
			{
				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("Float_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");
		}
	}

}
