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

/*
 * @(#)callStmtClient6.java	1.6 02/01/12
 */

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

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 callStmtClient6 class tests methods of CallableStatement interface (to check the
 * Support for IN, OUT and INOUT parameters of Stored Procedure) using
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.7, 06/16/99
 */

public class callStmtClient6 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt6";

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

	//Harness requirements

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

	/* Run test in standalone mode */
	public static void main(String[] args)
	{
		callStmtClient6 theTests = new callStmtClient6();
		Status s=theTests.run(args, System.out, System.err);
		s.exit();
	}

	/*  Test setup: */
	/*
	 *   @class.setup_props: Driver, the Driver name;
	 *			db1, the database name with url;
	 *			user1, the database user name;
	 *			password1, the database password;
	 *			db2, the database name with url;
	 *			user2, the database user name;
	 *			password2, the database password;
	 *			DriverManager, flag for DriverManager;
	 *			ptable, the primary table;
	 *			ftable, the foreign table;
	 *			cofSize, the initial size of the ptable;
	 *			cofTypeSize, the initial size of the ftable;
	 *			binarySize, size of binary data type;
	 *			varbinarySize, size of varbinary data type;
	 *			longvarbinarySize, size of longvarbinary data type;
	 *  @class.testArgs:     -ap ctssql.stmt
	 */
	public void setup(String[] args, Properties p) throws Fault
	{
		try
		{
			try
			{
				drManager = p.getProperty("DriverManager","");
				if (drManager.length() == 0)
					throw new Fault("Invalid DriverManager Name");
				sqlp=p;

				if(drManager.equals("yes"))
				{
					logMsg("Using DriverManager");
					DriverManagerConnection dmCon = new DriverManagerConnection();
					conn = dmCon.getConnection(p);
				}
				else
				{
					logMsg("Using DataSource");
					DataSourceConnection dsCon = new DataSourceConnection();
					conn = dsCon.getConnection(p);
				}
				rsSch = new rsSchema();
				stmt = conn.createStatement(/*ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY*/);
				dbmd =  conn.getMetaData();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception : " + ex.getMessage());
			}
		}
		catch ( Exception e )
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}


	/*
	 * @testName:         testSetString01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setChar(int parameterIndex,String x),update the column the
	 *                    minimum value of Char_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt
	 *                     file. Both of them should be equal.
	 */
	public void testSetString01() throws Fault
	{
		String  minStringVal = null;
		String  rStringVal = null;
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);

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

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

			//to set the Long
			cstmt.setString(1,minStringVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			rStringVal= rs.getString(1);
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ minStringVal);

			if (rStringVal.trim().equals(minStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetString02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setString(int parameterIndex,String x),update the column the
	 *                    maximum value of Char_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */

	public void testSetString02() throws Fault
	{
		String  maxStringVal = null;
		String  rStringVal = null;
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);

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

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

			//to set the String
			cstmt.setString(1,maxStringVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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= rs.getString(1);
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ maxStringVal);

			if (rStringVal.trim().equals(maxStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetString03
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setString(int parameterIndex,String x),update the column the
	 *                    minimum value of Varchar_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetString03() throws Fault
	{
		String  minStringVal = null;
		String  rStringVal = null;
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//to set the Long
			cstmt.setString(1,minStringVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			rStringVal= rs.getString(1);
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ minStringVal);

			if (rStringVal.trim().equals(minStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetString04
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setString(int parameterIndex,String x),update the column the
	 *                    maximum value of Varchar_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetString04() throws Fault
	{
		String  maxStringVal	= null;
		String  rStringVal	= null;
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//to set the String
			cstmt.setString(1,maxStringVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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= rs.getString(1);
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ maxStringVal);

			if (rStringVal.trim().equals(maxStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Varchar_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetString05
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setString(int parameterIndex,String x),update the column the
	 *                    minimum value of Longvarchar_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetString05() throws Fault
	{
		String  minStringVal = null;
		String  rStringVal = null;
		try
		{
			rsSch.createTab("Longvarchar_Tab",sqlp,conn);

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

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

			//to set the Long
			cstmt.setString(1,minStringVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			InputStream is = rs.getAsciiStream(1);
			System.out.println("AsciiStream Created");
			BufferedReader d = new BufferedReader(new InputStreamReader(is));
			System.out.println("BufferedReader Stream Created");
			rStringVal = d.readLine();
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ minStringVal);

			if (rStringVal.trim().equals(minStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarchar_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetString06
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setString(int parameterIndex, String x) method sets the designated
	 *                    parameter to a Java String value. The driver converts this to an
	 *                    SQL VARCHAR or LONGVARCHAR value (depending on the argument's size
	 *                    relative to the driver's limits on VARCHAR values) when it sends
	 *                    it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setString(int parameterIndex,String x),update the column the
	 *                    maximum value of Longvarchar_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetString06() throws Fault
	{
		String  maxStringVal = null;
		String  rStringVal = null;
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

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

			//to set the String
			cstmt.setString(1,maxStringVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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();

			InputStream is = rs.getAsciiStream(1);
			System.out.println("AsciiStream Created");
			BufferedReader d = new BufferedReader(new InputStreamReader(is));
			System.out.println("BufferedReader Stream Created");
			rStringVal = d.readLine();
			logMsg("Returned String Value after Updation:"+ rStringVal);
			logMsg("Returned String Value from database:"+ maxStringVal);

			if (rStringVal.trim().equals(maxStringVal.trim()))
			{
				logMsg("setString Method sets the designated parameter to a String value ");
			}
			else
			{
				logErr("setString Method does not set the designated parameter to a String value ");
				throw new Fault("Call to setString Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setString is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setString Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Longvarcharnull_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetBigDecimal01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBigDecimal(int parameterIndex,BigDecimal x) method sets the
	 *                    designated parameter to a java.lang.BigDecimal value. The driver
	 *                    converts thisto an SQL NUMERIC value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,,update the column Max_Val
	 *                    of Decimal_Tab with the minimum value.Execute a query to get the
	 *                    minimum value and retrieve the result of the query using the
	 *                    getBigDecimal(int parameterIndex) method.Compare the returned
	 *                    value with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetBigDecimal01() throws Fault
	{
		BigDecimal oRetVal=null;
		BigDecimal oExtVal=null;
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String sminStringVal = rsSch.extractVal("Decimal_Tab",2,sqlp,conn);
			oExtVal = new BigDecimal(sminStringVal);
			logMsg("Minimum decimal Value to be updated :" +oExtVal);

			//setting the value
			cstmt.setBigDecimal(1,oExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal= rs.getBigDecimal(1);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

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


	/*
	 * @testName:         testSetBigDecimal02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBigDecimal(int parameterIndex,BigDecimal x) method sets the
	 *                    designated parameter to a java.lang.BigDecimal value. The driver
	 *                    converts thisto an SQL NUMERIC value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database.
	 *                    Using the IN parameter of that object,update the column Null_Val
	 *                    of Decimal_Tab with the maximum value.Execute a query to get the
	 *                    maximum value and retrieve the result of the query using the
	 *                    getBigDecimal(int parameterIndex) method.Compare the returned
	 *                    value with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetBigDecimal02() throws Fault
	{
		BigDecimal oRetVal=null;
		BigDecimal oExtVal=null;
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String smaxStringVal = rsSch.extractVal("Decimal_Tab",1,sqlp,conn);
			oExtVal = new BigDecimal(smaxStringVal);
			logMsg("Maximum decimal Value to be updated :" +oExtVal);

			//setting the value
			cstmt.setBigDecimal(1,oExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal= rs.getBigDecimal(1);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

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


	/*
	 * @testName:         testSetBigDecimal03
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBigDecimal(int parameterIndex,BigDecimal x) method sets the
	 *                    designated parameter to a java.lang.BigDecimal value. The driver
	 *                    converts thisto an SQL NUMERIC value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,,update the column Max_Val
	 *                    of Numeric_Tab with the minimum value.Execute a query to get the
	 *                    minimum value and retrieve the result of the query using the
	 *                    getBigDecimal(int parameterIndex) method.Compare the returned
	 *                    value with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetBigDecimal03() throws Fault
	{
		BigDecimal oRetVal=null;
		BigDecimal oExtVal=null;
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);

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

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

			//setting the value
			cstmt.setBigDecimal(1,oExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal= rs.getBigDecimal(1);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

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


	/*
	 * @testName:         testSetBigDecimal04
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBigDecimal(int parameterIndex,BigDecimal x) method sets the
	 *                    designated parameter to a java.lang.BigDecimal value. The driver
	 *                    converts thisto an SQL NUMERIC value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database.
	 *                    Using the IN parameter of that object,update the column Null_Val
	 *                    of Numeric_Tab with the maximum value.Execute a query to get the
	 *                    maximum value and retrieve the result of the query using the
	 *                    getBigDecimal(int parameterIndex) method.Compare the returned
	 *                    value with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetBigDecimal04() throws Fault
	{
		BigDecimal oRetVal=null;
		BigDecimal oExtVal=null;
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);

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

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

			//setting the value
			cstmt.setBigDecimal(1,oExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal= rs.getBigDecimal(1);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

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


	/*
	 * @testName:         testSetBoolean01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBoolean(int parameterIndex,boolean x) method sets the
	 *                    designated parameter to a Java boolean value. The driver converts
	 *                    this to an SQL BIT value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,update the column Max_Val of
	 *                    Bit_Tab with the minimum value.Execute a query to get the minimum
	 *                    value and retrieve the result of the query using the
	 *                    getBoolean(int parameterIndex) method.Compare the returned value
	 *                    with the minimum value extracted from the ctssql.stmt file.Both of
	 *                    them should be equal.
	 */
	public void testSetBoolean01() throws Fault
	{
		Boolean oRetVal=null;
		Boolean oExtVal=null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String sminStringVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);
			oExtVal = new Boolean(sminStringVal);
			logMsg("Minimum Boolean Value to be updated :" +oExtVal);

			//Setting the value
			boolean bExtVal = oExtVal.booleanValue();
			cstmt.setBoolean(1,bExtVal);

			//execute the procedure
			cstmt.executeUpdate();

			//query from the database to check the call of cstmt.executeUpdate
			String Max_Val_Query=sqlp.getProperty("Bit_Query_Max","");
			logMsg("Query String :" +Max_Val_Query);
			rs=stmt.executeQuery(Max_Val_Query);
			rs.next();
			boolean bRetVal= rs.getBoolean(1);

			oRetVal = new Boolean(bRetVal);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

			if(oRetVal.equals(oExtVal))
			{
				logMsg("setBoolean set the Minimum value " + oRetVal);
			}
			else
			{
				logErr("setBoolean did not set the Minimum value");
				throw new Fault("Call to setBoolean Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setBoolean is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " +e.getMessage());
			throw new Fault("Call to setBoolean Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +e);
			}
		}
	}


	/*
	 * @testName:         testSetBoolean02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setBoolean(int parameterIndex,boolean x) method sets the
	 *                    designated parameter to a Java boolean value. The driver converts
	 *                    this to an SQL BIT value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,update the column Null_Val of
	 *                    Bit_Tab with the maximum value.Execute a query to get the maximum
	 *                    value and retrieve the result of the query using the
	 *                    getBoolean(int parameterIndex) method.Compare the returned value
	 *                    with the maximum value extracted from the with ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetBoolean02() throws Fault
	{
		Boolean oRetVal=null;
		Boolean oExtVal=null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String smaxStringVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);
			oExtVal = new Boolean(smaxStringVal);
			logMsg("Maximum Boolean Value to be updated :" +oExtVal);

			//Setting the value
			boolean bExtVal = oExtVal.booleanValue();
			cstmt.setBoolean(1,bExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal = new Boolean(bRetVal);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

			if(oRetVal.equals(oExtVal))
			{
				logMsg("setBoolean set the Maximum value " + oRetVal);
			}
			else
			{
				logErr("setBoolean did not set the Maximum value");
				throw new Fault("Call to setBoolean Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setBoolean is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " +e.getMessage());
			throw new Fault("Call to setBoolean Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +e);
			}
		}
	}


	/*
	 * @testName:         testSetByte01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setByte(int parameterIndex,byte x) method sets the designated
	 *                    parameter to a Java byte value. The driver converts this to an SQL
	 *                    TINYINT value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,update the column Max_Val of
	 *                    Tinyint_Tab with the minimum value.Execute a query to get the minimum
	 *                    value and retrieve the result of the query using the
	 *                    getByte(int parameterIndex) method.Compare the returned value with
	 *                    the minimum value extracted from the ctssql.stmt file.Both of them
	 *                    should be equal.
	 */
	public void testSetByte01() throws Fault
	{
		Byte oRetVal=null;
		Byte oExtVal=null;
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String sminStringVal = rsSch.extractVal("Tinyint_Tab",2,sqlp,conn);
			oExtVal = new Byte(sminStringVal);
			logMsg("Minimum Byte Value to be updated :" +oExtVal);
			byte bExtVal = oExtVal.byteValue();

			//Setting the value
			cstmt.setByte(1,bExtVal);

			//execute the procedure
			cstmt.executeUpdate();

			//query from the database to check the call of cstmt.executeUpdate
			String Max_Val_Query=sqlp.getProperty("Tinyint_Query_Max","");
			logMsg("Query String :" +Max_Val_Query);
			rs=stmt.executeQuery(Max_Val_Query);
			rs.next();
			byte bRetVal= rs.getByte(1);

			oRetVal = new Byte(bRetVal);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

			if(oRetVal.equals(oExtVal))
			{
				logMsg("setByte set the Minimum value " + oRetVal);
			}
			else
			{
				logErr("setByte did not set the Minimum value");
				throw new Fault("Call to setByte Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setByte is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " +e.getMessage());
			throw new Fault("Call to setByte Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +e);
			}
		}
	}


	/*
	 * @testName:         testSetByte02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setByte(int parameterIndex,byte x) method sets the designated
	 *                    parameter to a Java byte value. The driver converts this to an SQL
	 *                    TINYINT value when it sends it to the database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    This test case is meant for checking the support for IN parameter
	 *                    in CallableStatement Interface.
	 *                    Get a CallableStatement object from the connection to the database
	 *                    Using the IN parameter of that object,update the column Max_Val of
	 *                    Tinyint_Tab with the minimum value.Execute a query to get the minimum
	 *                    value and retrieve the result of the query using the
	 *                    getByte(int parameterIndex) method.Compare the returned value with
	 *                    the minimum value extracted from the ctssql.stmt file. Both of
	 *                    them should be equal.
	 */
	public void testSetByte02() throws Fault
	{
		Byte oRetVal=null;
		Byte oExtVal=null;
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);

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

			//to extract the Minimum Value to be Updated
			String smaxStringVal = rsSch.extractVal("Tinyint_Tab",1,sqlp,conn);
			oExtVal = new Byte(smaxStringVal);
			logMsg("Maximum Byte Value to be updated :" +oExtVal);

			//Setting the value
			byte bExtVal = oExtVal.byteValue();
			cstmt.setByte(1,bExtVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal = new Byte(bRetVal);
			logMsg("Extracted value from the ctssql.stmt :"+ oExtVal);
			logMsg("Returned value from the database :"+ oRetVal);

			if(oRetVal.equals(oExtVal))
			{
				logMsg("setByte set the Maximum value " + oRetVal);
			}
			else
			{
				logErr("setByte did not set the Maximum value");
				throw new Fault("Call to setByte Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setByte is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " +e.getMessage());
			throw new Fault("Call to setByte Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Tinyint_Tab",conn);
			}
			catch(Exception e)
			{
				logMsg("Exception in finally block" +e);
			}
		}
	}

	/*
	 * @testName:         testSetShort01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setShort(int parameterIndex, short x) method Sets the
	 *                    designated parameter to a Java short value. The driver converts
	 *                    this to an SQL SMALLINT value when it sends it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setShort(int parameterIndex,short x),update the column the
	 *                    minimum value of Smallint_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getShort(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetShort01() throws Fault
	{
		short minShortVal;
		short rShortVal;
		String  minStringVal = null;
		String  sminStringVal = null;
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

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

			//to extract the Minimum Value of Smallint to be Updated
			sminStringVal = rsSch.extractVal("Smallint_Tab",2,sqlp,conn);
			minStringVal=new String(sminStringVal);
			minShortVal = Short.parseShort(sminStringVal);
			logMsg("Minimum Smallint Value to be updated :" + minShortVal);

			//to set the Short
			cstmt.setShort(1,minShortVal);

			//execute the procedure
			cstmt.executeUpdate();

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

			rShortVal= rs.getShort(1);
			logMsg("Returned Short Value after Updation:"+ rShortVal);
			logMsg("Returned Short Value from database:"+ minShortVal);

			if (rShortVal == minShortVal)
			{
				logMsg("setShort Method sets the designated parameter to a Short value ");
			}
			else
			{
				logErr("setShort Method does not set the designated parameter to a Short value ");
				throw new Fault("Call to setShort Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setShort is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setShort Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetShort02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setShort(int parameterIndex, short x) method Sets the
	 *                    designated parameter to a Java short value. The driver converts
	 *                    this to an SQL SMALLINT value when it sends it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setShort(int parameterIndex,short x),update the column the
	 *                    maximum value of Smallint_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getShort(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetShort02() throws Fault
	{
		short maxShortVal;
		short rShortVal;
		String  maxStringVal = null;
		String  smaxStringVal = null;
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);

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

			//to extract the Maximum Value of Smallint to be Updated
			smaxStringVal = rsSch.extractVal("Smallint_Tab",1,sqlp,conn);
			maxStringVal=new String(smaxStringVal);
			maxShortVal = Short.parseShort(smaxStringVal);
			logMsg("Maximum Smallint Value to be updated :" + maxShortVal);

			//to set the Short
			cstmt.setShort(1,maxShortVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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();
			rShortVal= rs.getShort(1);
			logMsg("Returned Short Value after Updation:"+ rShortVal);
			logMsg("Returned Short Value from database:"+ maxShortVal);

			if (rShortVal == maxShortVal)
			{
				logMsg("setShort Method sets the designated parameter to a Short value ");
			}
			else
			{
				logErr("setShort Method does not set the designated parameter to a Short value ");
				throw new Fault("Call to setShort Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setShort is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setShort Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetInt01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setInt(int parameterIndex,int x) method sets parameter number
	 *                    parameterIndex to Java int value x. The driver converts this to an
	 *                    SQL INTEGER value when it sends it to the Database.
     *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setInt(int parameterIndex,int x),update the column the
	 *                    minimum value of Integer_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetInt01() throws Fault
	{
		int minIntegerVal;
		int rIntegerVal;
		String  minStringVal	= null;
		String  sminStringVal	= null;
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

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

			//to extract the Minimum Value of int to be Updated
			sminStringVal = rsSch.extractVal("Integer_Tab",2,sqlp,conn);
			minStringVal=new String(sminStringVal);
			minIntegerVal = Integer.parseInt(sminStringVal);
			logMsg("Minimum int Value to be updated :" + minIntegerVal);

			//to set the Integer
			cstmt.setInt(1,minIntegerVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.executeUpdate
			//to get the query string
			String Max_Val_Query=sqlp.getProperty("Integer_Query_Max","");
			logMsg(Max_Val_Query);
			rs=stmt.executeQuery(Max_Val_Query);
			rs.next();
			rIntegerVal= rs.getInt(1);
			logMsg("Returned int Value after Updation:"+ rIntegerVal);
			logMsg("Returned int Value from database:"+ minIntegerVal);

			if (rIntegerVal == minIntegerVal)
			{
				logMsg("setInt Method sets the designated parameter to a int value ");
			}
			else
			{
				logErr("setInt Method does not set the designated parameter to a int value ");
				throw new Fault("Call to setInt Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setInt is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setInt Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetInt02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setInt(int parameterIndex,int x) method sets parameter number
	 *                    parameterIndex to Java int value x. The driver converts this to an
	 *                    SQL INTEGER value when it sends it to the Database.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setInt(int parameterIndex,int x),update the column the
	 *                    maximum value of Integer_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetInt02() throws Fault
	{
		int maxIntegerVal;
		String maxStringVal = null;
		int rIntegerVal;
		String smaxStringVal = null;
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);

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

			//to extract the Maximum Value of int to be Updated
			smaxStringVal = rsSch.extractVal("Integer_Tab",1,sqlp,conn);
			maxStringVal=new String(smaxStringVal);
			maxIntegerVal = Integer.parseInt(smaxStringVal);
			logMsg("Maximum int Value to be updated :" + maxIntegerVal);

			//to set the Integer
			cstmt.setInt(1,maxIntegerVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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();
			rIntegerVal= rs.getInt(1);
			logMsg("Returned int Value after Updation:"+ rIntegerVal);
			logMsg("Returned int Value from database:"+ maxIntegerVal);

			if (rIntegerVal == maxIntegerVal)
			{
				logMsg("setInt Method sets the designated parameter to a int value ");
			}
			else
			{
				logErr("setInt Method does not set the designated parameter to a int value ");
				throw new Fault("Call to setInt Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setInt is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setInt Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetLong01
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setLong(int parameterIndex, long x) method Sets the
	 *                    designated parameter to a Java long value. The driver converts
	 *                    this to an SQL BIGINT value when it sends it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setLong(int parameterIndex,long x),update the column the
	 *                    minimum value of Bigint_Tab.
	 *                    Now execute a query to get the minimum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the minimum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetLong01() throws Fault
	{
		long minLongVal;
		long rLongVal;
		String  minStringVal = null;
		String  sminStringVal = null;
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

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

			//to extract the Minimum Value of int to be Updated
			sminStringVal = rsSch.extractVal("Bigint_Tab",2,sqlp,conn);
			minStringVal=new String(sminStringVal);
			minLongVal = Long.parseLong(sminStringVal);
			logMsg("Minimum long Value to be updated :" + minLongVal);

			//to set the Long
			cstmt.setLong(1,minLongVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.executeUpdate
			//to get the query string
			String Max_Val_Query=sqlp.getProperty("Bigint_Query_Max","");
			logMsg(Max_Val_Query);
			rs=stmt.executeQuery(Max_Val_Query);
			rs.next();
			rLongVal= rs.getLong(1);
			logMsg("Returned long Value after Updation:"+ rLongVal);
			logMsg("Returned long Value from database:"+ minLongVal);

			if (rLongVal == minLongVal)
			{
				logMsg("setLong Method sets the designated parameter to a long value ");
			}
			else
			{
				logErr("setLong Method does not set the designated parameter to a long value ");
				throw new Fault("Call to setLong Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setLong is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setLong Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/*
	 * @testName:         testSetLong02
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setLong(int parameterIndex, long x) method Sets the
	 *                    designated parameter to a Java long value. The driver converts
	 *                    this to an SQL BIGINT value when it sends it to the database.
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    Using setLong(int parameterIndex,long x),update the column the
	 *                    maximum value of Bigint_Tab.
	 *                    Now execute a query to get the maximum value and retrieve the result
	 *                    of the query using the getInt(int columnIndex) method.Compare the
	 *                    returned value, with the maximum value extracted from the ctssql.stmt file.
	 *                    Both of them should be equal.
	 */
	public void testSetLong02() throws Fault
	{
		long maxLongVal;
		long rLongVal;
		String maxStringVal = null;
		String smaxStringVal = null;
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);

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

			//to extract the Maximum Value of int to be Updated
			smaxStringVal = rsSch.extractVal("Bigint_Tab",1,sqlp,conn);
			maxStringVal=new String(smaxStringVal);
			maxLongVal = Long.parseLong(smaxStringVal);
			logMsg("Maximum long Value to be updated :" + maxLongVal);

			//to set the Long
			cstmt.setLong(1,maxLongVal);

			//execute the procedure
			cstmt.executeUpdate();

			//to query from the database to check the call of cstmt.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();
			rLongVal= rs.getLong(1);
			logMsg("Returned long Value after Updation:"+ rLongVal);
			logMsg("Returned long Value from database:"+ maxLongVal);

			if (rLongVal == maxLongVal)
			{
				logMsg("setLong Method sets the designated parameter to a long value ");
			}
			else
			{
				logErr("setLong Method does not set the designated parameter to a long value ");
				throw new Fault("Call to setLong Method is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to setLong is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to setLong Failed!", e);
		}
		finally
		{
			try
			{
				if(rs!=null)
				{
					rs.close();
					rs=null;
				}
				if(stmt!=null)
				{
					stmt.close();
					stmt=null;
				}
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);
			}
			catch(Exception e)
			{
			}
		}
	}


	/* cleanup */
	public void  cleanup() throws Fault
	{
		try
		{
			//Close the database
			rsSch.dbUnConnect(conn);
			logMsg("Cleanup ok;");
		}
		catch (Exception e)
		{
			logErr("An error occurred while closing the database connection");
		}
	}
}
