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

/*
 * @(#)callStmtClient19.java	1.10 02/01/12
 */

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

import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DateFormat;

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

	//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)
	{
		callStmtClient19 theTests = new callStmtClient19();
		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:         testSetObject221
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Date object for SQL Type Date and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject221() throws Fault
	{
		
		java.sql.Date oRetVal=null;
		java.sql.Date mfgDateVal=null;
		String sMfgDateVal = null ;
		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.executeUpdate();

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

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


	/*
	 * @testName:         testSetObject222
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Date object for SQL Type Timestamp and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject222() throws Fault
	{
		java.sql.Date mfgDateVal = null ;
		String sMfgStringVal=null;
		java.sql.Timestamp rTimestampVal=null;
		Timestamp mfgTimestampVal = null ;
		java.sql.Date rDateVal = null ;

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

			//to extract the Value of Timestamp to be Updated to Null Value of Timestamp Table
			sMfgStringVal = rsSch.extractVal("Timestamp_Tab",1,sqlp,conn);
			sMfgStringVal=sMfgStringVal.substring(sMfgStringVal.indexOf('\'')+1,sMfgStringVal.lastIndexOf('\''));
			logMsg("String Value for Timestamp:" + sMfgStringVal);
			mfgTimestampVal = Timestamp.valueOf(sMfgStringVal);
			logMsg("Timestamp Value :" + mfgTimestampVal);

			sMfgStringVal=sMfgStringVal.substring(0,sMfgStringVal.indexOf(' '));
			mfgDateVal = java.sql.Date.valueOf(sMfgStringVal);
			logMsg("Date Value :" + mfgDateVal);

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

			//execute the procedure
			cstmt.executeUpdate();

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

			java.util.Date oDateVal=(java.util.Date) rs.getObject(1);
			long lDate = oDateVal.getTime();
			
			rDateVal = new java.sql.Date(lDate);
			logMsg("Value extracted from ctssql.stmt :" +mfgDateVal);
			logMsg("Value returned from table :" +rDateVal);

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


	/*
	 * @testName:         testSetObject223
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Time object for SQL Type Char and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject223() throws Fault
	{
		
		java.sql.Time oRetVal=null;
		java.sql.Time brkTimeVal=null;
		String sBrkTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.executeUpdate();

			String Null_Val_Query=sqlp.getProperty("Char_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			retStringVal = (String) rs.getObject(1);
			retStringVal = retStringVal.trim();

			oRetVal=java.sql.Time.valueOf(retStringVal);
			logMsg("Value extracted from ctssql.stmt :" +brkTimeVal);
			logMsg("Value returned from table :" +oRetVal);

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


	/*
	 * @testName:         testSetObject224
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Time object for SQL Type Varchar and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject224() throws Fault
	{
		
		java.sql.Time oRetVal=null;
		java.sql.Time brkTimeVal=null;
		String sBrkTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal=java.sql.Time.valueOf(retStringVal);
			logMsg("Value extracted from ctssql.stmt :" +brkTimeVal);
			logMsg("Value returned from table :" +oRetVal);

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


	/*
	 * @testName:         testSetObject225
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Time object for SQL Type Longvarchar and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject225() throws Fault
	{
		
		java.sql.Time oRetVal=null;
		java.sql.Time brkTimeVal=null;
		String sBrkTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

			brkTimeVal = Time.valueOf(sBrkTimeVal);

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

			//execute the procedure
			cstmt.executeUpdate();

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


	/*
	 * @testName:         testSetObject226
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Time object for SQL Type Time and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject226() throws Fault
	{
		
		java.sql.Time oRetVal=null;
		java.sql.Time brkTimeVal=null;
		String sBrkTimeVal = null ;
		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);

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

			brkTimeVal = Time.valueOf(sBrkTimeVal);

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

			//execute the procedure
			cstmt.executeUpdate();

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

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


	/*
	 * @testName:         testSetObject227
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Char and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject227() throws Fault
	{
		
		java.sql.Timestamp oRetVal=null;
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);


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

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

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal=java.sql.Timestamp.valueOf(retStringVal);
			logMsg("Value extracted from ctssql.stmt :" +inTimeVal);
			logMsg("Value returned from table :" +oRetVal);

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

	/*
	 * @testName:         testSetObject228
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Varchar and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject228() throws Fault
	{
		
		java.sql.Timestamp oRetVal=null;
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.executeUpdate();

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

			oRetVal=java.sql.Timestamp.valueOf(retStringVal);
			logMsg("Value extracted from ctssql.stmt :" +inTimeVal);
			logMsg("Value returned from table :" +oRetVal);


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


	/*
	 * @testName:         testSetObject229
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Longvarchar and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject229() throws Fault
	{
		
		java.sql.Timestamp oRetVal=null;
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal = null ;
		String retStringVal=null;
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);

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

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

			String Null_Val_Query=sqlp.getProperty("Longvarchar_Query_Null","");
			logMsg(Null_Val_Query);
			rs=stmt.executeQuery(Null_Val_Query);
			rs.next();
			retStringVal = (String) rs.getObject(1);
			retStringVal = retStringVal.trim();

			oRetVal=java.sql.Timestamp.valueOf(retStringVal);
			logMsg("Value extracted from ctssql.stmt :" +inTimeVal);
			logMsg("Value returned from table :" +oRetVal);

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

	/*
	 * @testName:         testSetObject230
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Date and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject230() throws Fault
	{
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal=null;
		java.sql.Date inDateVal = null ;
		java.sql.Date rDateVal=null;

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

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

			sInTimeVal = sInTimeVal.substring(0,sInTimeVal.indexOf(' '));
			inDateVal = java.sql.Date.valueOf(sInTimeVal);

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

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

			java.util.Date oDateVal=(java.util.Date) rs.getObject(1);
			long lDate = oDateVal.getTime();
			rDateVal = new java.sql.Date(lDate);
			logMsg("Returned Value from ctssql.stmt:" + inDateVal);
			logMsg("Value returned from table :" +rDateVal);

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

	}


	/*
	 * @testName:         testSetObject231
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Time and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject231() throws Fault
	{
		java.sql.Time brkTimeVal = null ;
		String sBrkStringVal=null;
		java.sql.Time rTimeVal=null;
		Timestamp brkTimestampVal = null ;

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

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

			brkTimestampVal = Timestamp.valueOf(sBrkStringVal);
			logMsg("Timestamp Value :" + brkTimestampVal);

			sBrkStringVal=sBrkStringVal.substring(sBrkStringVal.indexOf(' ')+1,sBrkStringVal.length());
			logMsg("String Value for Time:" + sBrkStringVal);
			brkTimeVal = java.sql.Time.valueOf(sBrkStringVal);
			logMsg("Time Value :" + brkTimeVal);

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

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

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


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

	}

	/*
	 * @testName:         testSetObject232
	 * @assertion:        A CallableStatement object provides a way to call stored procedures
	 *                    in a standard way for all RDBMSs.  It can take variable number of
	 *                    parameters used for input (IN parameters), output (OUT parameters)
	 *                    or both (INOUT parameters).  (See section 9.1 of JDBC 2.0 API
	 *                    Reference & Tutorial, Second Edition)
	 *
	 *                    The drivers must provide full support for CallableStatement methods
	 *                    that apply to SQL92 types.  All parameter types (IN, OUT, INOUT)
	 *                    must be supported (See section 6.2.2.3 of Java2 Platform Enterprise
	 *                    Edition (J2EE) specification v 1.2)
	 *
	 *                    The setObject(int parameterIndex, Object x) 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 CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the
	 *                    setObject(int parameterIndex, Object x,int jdbcType) method to
	 *                    set Timestamp object for SQL Type Timestamp and call
	 *                    statement.executeQuery method and call getObject method of ResultSet.
	 *                    It should return a String object that is been set.
	 *
	 */
	public void testSetObject232() throws Fault
	{
		
		java.sql.Timestamp oRetVal=null;
		java.sql.Timestamp inTimeVal=null;
		String sInTimeVal = null ;
		try
		{
			rsSch.createTab("Timestamp_Tab",sqlp,conn);

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

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

			//execute the procedure
			cstmt.executeUpdate();

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


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


	/*
	 * @testName:         testRegisterOutParameter01
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBigDecimal() method to
	 *                    set maximum BigDecimal value in null column and call registerOutParameter
	 *                    method and call getBigDecimal method.  It should return a BigDecimal
	 *                    object that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter01() throws Fault
	{
		String sMaxNumericVal=null;
		BigDecimal maxDecimalVal=null;
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_Io_Null(?)}");
			cstmt.setBigDecimal(1,maxDecimalVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBigDecimal(MAX_VAL)");
			//invoke getBigDecimal method
			BigDecimal oRetVal = cstmt.getBigDecimal(1);
			logMsg("Returned Value from ctssql.stmt:" + maxDecimalVal);
			logMsg("Value returned from table :" +oRetVal);

			if( (maxDecimalVal.compareTo(oRetVal)==0) )
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter02
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBigDecimal() method to
	 *                    set minimum BigDecimal value in maximum value column and call
	 *                    registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getBigDecimal method.  It should return a BigDecimal
	 *                    object that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter02() throws Fault
	{
		String sMinNumericVal = null;
		BigDecimal minDecimalVal = null;
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_Io_Max(?)}");
			cstmt.setBigDecimal(1,minDecimalVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBigDecimal(MAX_VAL)");
			//invoke getBigDecimal method
			BigDecimal oRetVal = cstmt.getBigDecimal(1);
			logMsg("Returned Value from ctssql.stmt:" + minDecimalVal);
			logMsg("Value returned from table :" +oRetVal);

			if( (minDecimalVal.compareTo(oRetVal)==0) )
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter03
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBigDecimal() method to
	 *                    set maximum Decimal value in null column and call registerOutParameter
	 *                    method and call getBigDecimal method.  It should return a BigDecimal
	 *                    object that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter03() throws Fault
	{
		String sMaxDecimalVal = null;
		BigDecimal maxDecimalVal = null;
		BigDecimal oRetVal = null;
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Decimal_Io_Null(?)}");
			cstmt.setBigDecimal(1,maxDecimalVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBigDecimal(NULL_VAL)");
			//invoke getBigDecimal method
			oRetVal = cstmt.getBigDecimal(1);
			logMsg("Returned Value from ctssql.stmt:" + maxDecimalVal);
			logMsg("Value returned from table :" +oRetVal);

			if( (maxDecimalVal.compareTo(oRetVal)==0) )
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);
			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter04
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setBigDecimal() method to
	 *                    set minimum Decimal value in maximum value column in Decimal table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getBigDecimal method.  It should return a BigDecimal
	 *                    object that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter04() throws Fault
	{
		String sMinDecimalVal = null;
		BigDecimal minDecimalVal = null;
		BigDecimal oRetVal = null;
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);

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

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Decimal_Io_Max(?)}");
			cstmt.setBigDecimal(1,minDecimalVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getBigDecimal(MAX_VAL)");
			//invoke getBigDecimal method
			oRetVal = cstmt.getBigDecimal(1);
			logMsg("Returned Value from ctssql.stmt:" + minDecimalVal);
			logMsg("Value returned from table :" +oRetVal);

			if( (minDecimalVal.compareTo(oRetVal)==0) )
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Decimal_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter05
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setDouble() method to
	 *                    set maximum Double value in null column and call registerOutParameter
	 *                    method and call getDouble method.  It should return a double value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter05() throws Fault
	{
		String sMaxDoubleVal=null;
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);

			sMaxDoubleVal = rsSch.extractVal("Double_Tab",1,sqlp,conn);
			double maxDoubleVal = Double.parseDouble(sMaxDoubleVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Io_Null(?)}");
			cstmt.setDouble(1,maxDoubleVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getDouble(NULL_VAL)");
			//invoke getDouble method
			double oRetVal = cstmt.getDouble(1);
			logMsg("Returned Value from ctssql.stmt:" + maxDoubleVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxDoubleVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Double_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter06
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setDouble() method to
	 *                    set minimum double value in maximum value column in Double table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getDouble method.  It should return a double value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter06() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);

			String sMinDoubleVal = rsSch.extractVal("Double_Tab",2,sqlp,conn);
			double minDoubleVal=Double.parseDouble(sMinDoubleVal);
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Io_Max(?)}");
			cstmt.setDouble(1,minDoubleVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getDouble(MAX_VAL)");
			//invoke getDouble method
			double oRetVal = cstmt.getDouble(1);
			logMsg("Returned Value from ctssql.stmt:" + minDoubleVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minDoubleVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Double_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/*
	 * @testName:         testRegisterOutParameter07
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setDouble() method to
	 *                    set maximum Float value in null column and call registerOutParameter
	 *                    method and call getDouble method.  It should return a double value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter07() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);

			String sMaxFloatVal = rsSch.extractVal("Float_Tab",1,sqlp,conn);
			double maxFloatVal = Double.parseDouble(sMaxFloatVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Io_Null(?)}");
			cstmt.setDouble(1,maxFloatVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getDouble(NULL_VAL)");
			//invoke getDouble method
			double oRetVal = cstmt.getDouble(1);
			logMsg("Returned Value from ctssql.stmt:" + maxFloatVal);
			logMsg("Value returned from table :" +oRetVal);

			if(maxFloatVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);

			}
			catch (Exception e) {}
		}
	}

	/*
	 * @testName:         testRegisterOutParameter08
	 * @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 registerOutParameter(int parameterIndex, int jdbcType) method
	 *                    registers the OUT parameter in ordinal position parameterIndex to the
	 *                    JDBC type jdbcType.  All OUT parameters should be registered before a
	 *                    stored procedure is executed. The JDBC type specified by sqlType for an
	 *                    OUT parameter determines the Java type that must be used in the get
	 *                    method to read the value of that parameter. If the JDBC type expected to
	 *                    be returned to this output parameter is specific to this particular
	 *                    database, sqlType should be java.sql.Types.OTHER. The method
	 *                    getObject(int) retrieves the value.  (See JDK 1.2.2 API Specification)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the database.
	 *                    execute the stored procedure and call the setDouble() method to
	 *                    set minimum float value in maximum value column in Float table and
	 *                    call registerOutParameter(int parameterIndex,int jdbcType,int scale)
	 *                    method and call getDouble method.  It should return a double value
	 *                    that is been set.  (Note: This test case also checks the support
	 *                    for INOUT parameter in Stored Procedure)
	 *
	 */
	public void testRegisterOutParameter08() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);

			String sMinFloatVal = rsSch.extractVal("Float_Tab",2,sqlp,conn);
			double minFloatVal=Double.parseDouble(sMinFloatVal);

			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Io_Max(?)}");
			cstmt.setDouble(1,minFloatVal);

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

			//execute the procedure
			cstmt.executeUpdate();
			logMsg("Calling CallableStatement.getDouble(MAX_VAL)");
			//invoke getDouble method
			double oRetVal = cstmt.getDouble(1);
			logMsg("Returned Value from ctssql.stmt:" + minFloatVal);
			logMsg("Value returned from table :" +oRetVal);

			if(minFloatVal == oRetVal)
				logMsg("registerOutParameter registers the OUT parameter");
			else
			{
				logErr("registerOutParameter does not register the OUT parameter");
				throw new Fault("Call to registerOutParameter is Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to registerOutParameter is Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt != null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);

			}
			catch (Exception e) {}
		}
	}


	/* cleanup */
	public void  cleanup() throws Fault
	{
		try
		{
			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");
		}
	}
}

