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

/*
 * @(#)callStmtClient3.java	1.12 02/01/12
 */
package com.sun.cts.tests.jdbc.ee.callStmt.callStmt3;

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 callStmtClient3 class tests methods of DatabaseMetaData interface using
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.7, 06/16/99
 */
public class callStmtClient3 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt3";
	//Naming specific member variables
	private CTSNamingContextInterface jc = null;
	//Harness requirements

	private transient Connection conn = null;
	private csSchema csSch=null;
	private rsSchema rsSch=null;
	private	String drManager=null;
	private Properties sqlp = null;
	private transient DatabaseMetaData dbmd=null;
	private	CallableStatement cstmt=null;
	private Properties props=null;

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


	/*
	 * @testName:         testGetObject01
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the maximum value of the parameter from Numeric_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject01() throws Fault
	{
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(2,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(3,java.sql.Types.NUMERIC,15);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.MaximumValue)");
			
			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Numeric_Tab",1,sqlp,conn);
			BigDecimal oExtVal = new BigDecimal(sRetStr);
			logMsg("getObject returns the Maximum value for type BigDecimal " + oRetVal);
			
			if( (oRetVal.compareTo(oExtVal)==0 ) )
				logMsg("getObject returns the Maximum value for type BigDecimal " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum value for type BigDecimal");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject02
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Numeric_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject02() throws Fault
	{
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(2,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(3,java.sql.Types.NUMERIC,15);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.MinimumValue)");
			
			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Numeric_Tab",2,sqlp,conn);
			BigDecimal oExtVal = new BigDecimal(sRetStr);
			logMsg("Value retrieved using cstmt		  :" + oRetVal);
			logMsg("Value extracted from ctsql.stmt   :" + oExtVal);
			
			if( (oRetVal.compareTo(oExtVal)==0) )
				logMsg("getObject returns the Minimum value for type BigDecimal " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum value of type BigDecimal");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
				
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject03
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value  from Numeric_Tab.
	 *                    Check if it returns null
	 */
	public void testGetObject03() throws Fault
	{
		try
		{
			rsSch.createTab("Numeric_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Numeric_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(2,java.sql.Types.NUMERIC,15);
			cstmt.registerOutParameter(3,java.sql.Types.NUMERIC,15);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.NullValue)");
			
			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(3);
			
			if(oRetVal == null)
				logMsg("getObject returns the Null value for type BigDecimal " + oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type BigDecimal");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Numeric_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject04
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method.to retrieve the maximum value of the parameter from Float_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject04() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(2,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(3,java.sql.Types.FLOAT);
			
			//execute the procedure
			cstmt.execute();
			String sRetStr = rsSch.extractVal("Float_Tab",1,sqlp,conn);
			logMsg("Calling CallableStatement.getObject(Double.MaximumValue(JDBC FLOAT))");
			
			try
			{
				//invoke getObject method

				Float oRetVal = (Float)cstmt.getObject(1);
				logMsg("It is a Float");								
				Float oExtVal = new Float(sRetStr);
				logMsg("Value retrieved using cstmt	  :" + oRetVal);
				logMsg("Value extracted from ctsql.stmt   :" + oExtVal);			
				if(oRetVal.compareTo(oExtVal)==0)
					logMsg("getObject returns the Maximum value for type Double(JDBC FLOAT) " + oRetVal);
				else
				{
					logErr("getObject did not return the Maximum value for type Double(JDBC FLOAT)");
					throw new Fault("Call to getObject Failed!");
				}		
			}
			catch(ClassCastException ce)			
			{
				logMsg("Assuming it is a Double");
				Double oRetVal = (Double)cstmt.getObject(1);
				logMsg("It is a Double");								
				Double oExtVal = new Double(sRetStr);
				logMsg("Value retrieved using cstmt	  :" + oRetVal);
				logMsg("Value extracted from ctsql.stmt   :" + oExtVal);
			
				if(oRetVal.compareTo(oExtVal)==0)
					logMsg("getObject returns the Maximum value for type Double(JDBC FLOAT) " + oRetVal);
				else
				{
					logErr("getObject did not return the Maximum value for type Double(JDBC FLOAT)");
					throw new Fault("Call to getObject Failed!");
				}		
			
			}
			
			
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch (Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject05
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Float_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject05() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(2,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(3,java.sql.Types.FLOAT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Double.MinimumValue(JDBC FLOAT))");
			
			
			String sRetStr = rsSch.extractVal("Float_Tab",2,sqlp,conn);
			try{
				//invoke getObject method
				Float oRetVal = (Float)cstmt.getObject(2);
				logMsg("It is a Float");
				Float oExtVal = new Float(sRetStr);
				logMsg("From ctssql value is " + sRetStr);
				logMsg("From cstmt value is " + oRetVal);
				if(oRetVal.compareTo(oExtVal)==0)
					logMsg("getObject returns the Minimum value for type Double(JDBC FLOAT) " + oRetVal);
				else
				{
					logErr("getObject did not return the Minimum value for type Double(JDBC FLOAT)");
					throw new Fault("Call to getObject Failed!");
				}
			}
			catch(ClassCastException ce)
			{
				//invoke getObject method
				Double oRetVal = (Double)cstmt.getObject(2);
				logMsg("It is a Double");
				Double oExtVal = new Double(sRetStr);
				logMsg("From ctssql value is " + sRetStr);
				logMsg("From cstmt value is " + oRetVal);
				if(oRetVal.compareTo(oExtVal)==0)
					logMsg("getObject returns the Minimum value for type Double(JDBC FLOAT) " + oRetVal);
				else
				{
					logErr("getObject did not return the Minimum value for type Double(JDBC FLOAT)");
					throw new Fault("Call to getObject Failed!");
				}
			
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject06
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Float_Tab.Check if it returns null
	 */
	public void testGetObject06() throws Fault
	{
		try
		{
			rsSch.createTab("Float_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Float_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(2,java.sql.Types.FLOAT);
			cstmt.registerOutParameter(3,java.sql.Types.FLOAT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Double.NullValue(JDBC FLOAT))");
			
			//invoke getObject method
			Float oRetVal = (Float)cstmt.getObject(3);			
			if(oRetVal == null)
				logMsg("getObject returns the Null value for type Double (JDBC FLOAT) " + oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type Double(JDBC FLOAT)");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Float_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject07
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the maximum value of the parameter from Smallint_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject07() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Smallint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(2,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(3,java.sql.Types.SMALLINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.MaximumValue(JDBC SMALLINT)).");
			
			//invoke getObject method
			String sRetVal = ""+cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Smallint_Tab",1,sqlp,conn);
			
			if(sRetVal.trim().equals(sRetStr.trim()))
				logMsg("getObject returns the Maximum value for type Integer(JDBC SMALLINT) " + sRetVal);
			else
			{
				logErr("getObject did not return the Maximum value for type Integer(JDBC SMALLINT)");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject08
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Smallint_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject08() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Smallint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(2,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(3,java.sql.Types.SMALLINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.MinimumValue(JDBC SMALLINT)).");
			
			//invoke getObject method
			String sRetVal = ""+cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Smallint_Tab",2,sqlp,conn);
			
			if(sRetVal.trim().equals(sRetStr.trim()))
				logMsg("getObject returns the Minimum value for type Integer(JDBC SMALLINT) " + sRetVal);
			else
			{
				logErr("getObject did not return the Minimum value for type Integer(JDBC SMALLINT)");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject09
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Smallint_Tab.Check if it returns null
	 */
	public void testGetObject09() throws Fault
	{
		try
		{
			rsSch.createTab("Smallint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Smallint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(2,java.sql.Types.SMALLINT);
			cstmt.registerOutParameter(3,java.sql.Types.SMALLINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.NullValue(JDBC SMALLINT))");
			
			//invoke getObject method
			Integer oRetVal = (Integer)cstmt.getObject(3);
			
			if(oRetVal == null)
				logMsg("getObject returns the Null value for type Integer(JDBC SMALLINT) " + oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type Integer(JDBC SMALLINT)");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Smallint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject10
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve a char value from Char_Tab.Extract the same char value
	 *                    from the ctssql.stmt file.Compare this value with the value returned
	 *                    by the getObject(int parameterIndex).Both the values should be equal.
	 */
	public void testGetObject10() throws Fault
	{
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Char_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.CHAR);
			cstmt.registerOutParameter(2,java.sql.Types.CHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.Name)");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(1);
			oRetVal = oRetVal.trim();
			String oExtVal = rsSch.extractVal("Char_Tab",1,sqlp,conn);
			oExtVal=oExtVal.trim();
			
			if(oRetVal.equals(oExtVal.substring(1,oExtVal.length()-1)))
				logMsg("getObject returns the Name for type String" + oRetVal);
			else
			{
				logErr("getObject did not return the Name for type String");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject11
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Char_Tab.Check if it returns null
	 */
	public void testGetObject11() throws Fault
	{
		try
		{
			rsSch.createTab("Char_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Char_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.CHAR);
			cstmt.registerOutParameter(2,java.sql.Types.CHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.NullValue)");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(2);
			
			if(oRetVal ==  null)
				logMsg("getObject returns the null value for type String " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type String");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Char_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject12
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the maximum value of the parameter from Integer_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject12() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Integer_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.MaximumValue)");
			
			//invoke getObject method
			Integer oRetVal = (Integer)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Integer_Tab",1,sqlp,conn);
			Integer oExtVal = new Integer(sRetStr);
			
			if(oRetVal.equals(oExtVal))
				logMsg("getObject returns the Maximum value for type Integer " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum value for type Integer");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject13
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Integer_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject13() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Integer_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.MinimumValue)");
			
			//invoke getObject method
			Integer oRetVal = (Integer)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Integer_Tab",2,sqlp,conn);
			Integer oExtVal = new Integer(sRetStr);
			
			if(oRetVal.equals(oExtVal))
				logMsg("getObject returns the Minimum value for type Integer " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum value for type Integer");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject14
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Integer_Tab.Check if it returns null
	 */
	public void testGetObject14() throws Fault
	{
		try
		{
			rsSch.createTab("Integer_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Integer_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(2,java.sql.Types.INTEGER);
			cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Integer.NullValue)");
			
			//invoke getObject method
			Integer oRetVal = (Integer)cstmt.getObject(3);
			
			if(oRetVal == null)
				logMsg("getObject returns the Null value for type Integer " +oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type Integer");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Integer_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject15
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the maximum value of the parameter from Bit_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject15() throws Fault
	{
	
		Boolean oMaxBooleanVal = null;
		boolean booleanVal;
		String smaxBooleanVal = null;
		String rStringVal = null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_Proc(?,?,?)}");
			
			//Extracting value from Bit_Tab
			smaxBooleanVal = rsSch.extractVal("Bit_Tab",1,sqlp,conn);
			
			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				
				oMaxBooleanVal = new Boolean(smaxBooleanVal);
			
			}
			
			else
			{
				booleanVal = (smaxBooleanVal.trim().equals("1"))? true : false;
				oMaxBooleanVal = new Boolean(booleanVal);
			
			}
			
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIT);
			cstmt.registerOutParameter(2,java.sql.Types.BIT);
			cstmt.registerOutParameter(3,java.sql.Types.BIT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Boolean.MaximumValue)");
			
			//invoke getObject method
			//Boolean oRetVal = (Boolean)cstmt.getObject(1);
			
			
			rStringVal = cstmt.getObject(1).toString();
			rStringVal = rStringVal.trim();
					
			//Boolean oExtVal = new Boolean(sRetStr);			
			
			logMsg("Value retrieved using cstmt.getObject :" + rStringVal);
			logMsg("Value extracted from ctsql.stmt   :" + oMaxBooleanVal);
			
			if(rStringVal.equals(oMaxBooleanVal.toString()) || rStringVal.equals(smaxBooleanVal.trim()))
					logMsg("getObject returns the Maximum value for type Boolean " + oMaxBooleanVal);
				else
				{
					logErr("getObject did not return the Maximum value for type Boolean");
					throw new Fault("Call to getObject Failed!");
				}
				
			
						
				
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject16
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Bit_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject16() throws Fault
	{	
		Boolean oMinBooleanVal = null;
		boolean booleanVal;
		String sminBooleanVal = null;
		String rStringVal = null;
		try
		{
			rsSch.createTab("Bit_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bit_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIT);
			cstmt.registerOutParameter(2,java.sql.Types.BIT);
			cstmt.registerOutParameter(3,java.sql.Types.BIT);
			
			
			//Extracting value from Bit_Tab
			sminBooleanVal = rsSch.extractVal("Bit_Tab",2,sqlp,conn);
			
			String testType = new String("BOOLEAN");
			if(csSch.supportsType(testType,conn))
			{
				
				oMinBooleanVal = new Boolean(sminBooleanVal);
			
			}
			
			else
			{
				booleanVal = (sminBooleanVal.trim().equals("1"))? true : false;
				oMinBooleanVal = new Boolean(booleanVal);
			
			}
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Boolean.MinimumValue)");
			
			//invoke getObject method
			//Boolean oRetVal = (Boolean)cstmt.getObject(2);
			
			
			rStringVal = cstmt.getObject(2).toString();
			rStringVal = rStringVal.trim();
			
			
			//Boolean oExtVal = new Boolean(sRetStr);
			logMsg("Value retrieved using cstmt       :" + rStringVal);
			logMsg("Value extracted from ctsql.stmt   :" + oMinBooleanVal);
			
			if(rStringVal.equals(oMinBooleanVal.toString()) || rStringVal.equals(sminBooleanVal.trim()))
					logMsg("getObject returns the Minimum value for type Boolean " + oMinBooleanVal);
				else
				{
					logErr("getObject did not return the Maximum value for type Boolean");
					throw new Fault("Call to getObject Failed!");
				}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bit_Tab",conn);
			}catch (Exception e) {};
		}
	}



	/*
	 * @testName:         testGetObject18
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the maximum value of the parameter from Bigint_Tab.
	 *                    Extract the maximum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject18() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(2,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(3,java.sql.Types.BIGINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Long.MaximumValue)");
			
			//invoke getObject method
			Long oRetVal = (Long)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Bigint_Tab",1,sqlp,conn);
			Long oExtVal = new Long(sRetStr);
			logMsg("Value retrieved using cstmt		  :" + oRetVal);
			logMsg("Value extracted from ctsql.stmt   :" + oExtVal);
			
			if(oRetVal.equals(oExtVal))
				logMsg("getObject returns the Maximum value for type Long " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum value for type Long");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject19
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the minimum value of the parameter from Bigint_Tab.
	 *                    Extract the minimum value from the ctssql.stmt file.Compare this
	 *                    value with the value returned by the getObject(int parameterIndex)
	 *                    Both the values should be equal.
	 */
	public void testGetObject19() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(2,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(3,java.sql.Types.BIGINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Long.MinimumValue)");
			
			//invoke getObject method
			Long oRetVal = (Long)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Bigint_Tab",2,sqlp,conn);
			Long oExtVal = new Long(sRetStr);
			logMsg("Value retrieved using cstmt		  :" + oRetVal);
			logMsg("Value extracted from ctsql.stmt   :" + oExtVal);
			
			if(oRetVal.equals(oExtVal))
				logMsg("getObject returns the Minimum value for type Long " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum value for type Long");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				if(cstmt!=null)
				{
					cstmt.close();
					cstmt=null;
				}
				rsSch.dropTab("Bigint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject20
	 * @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 method getObject(int parameterIndex) gets the value of
	 *                    a parameter as an Object in the Java programming language.
	 *                    This method returns a Java object whose type corresponds to the
	 *                    JDBC type that was registered for this parameter using the method
	 *                    registerOutParameter.By registering the target JDBC type as java.
	 *                    sql.Types.OTHER, this method can be used to read database-specific
	 *                    abstract data types.
	 *                    It will return a java.lang.Object holding the OUT parameter value.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a CallableStatement object from the connection to the
	 *                    database.Register the parameter using
	 *                    registerOutParameter(int parameterIndex,int sqlType,int scale) method.
	 *                    Execute the stored procedure and call the getObject(int parameterIndex)
	 *                    method to retrieve the null value from Bigint_Tab.Check if it returns null
	 */
	public void testGetObject20() throws Fault
	{
		try
		{
			rsSch.createTab("Bigint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Bigint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(2,java.sql.Types.BIGINT);
			cstmt.registerOutParameter(3,java.sql.Types.BIGINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Long.NullValue)");
			
			//invoke getObject method
			Long oRetVal = (Long)cstmt.getObject(3);
			logMsg("Value retrieved using cstmt		  :" + oRetVal);
			
			if(oRetVal == null)
				logMsg("getObject returns the Null value for type Long " + oRetVal);
			else
			{
				logErr("getObject did not return the Null value for type Long");
				throw new Fault("Call to getObject Failed!");
			}
		}
		catch(SQLException sqle)
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getObject is Failed!");
		}
		catch ( Exception e )
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getObject Failed!", e);
		}
		finally
		{
			try
			{
				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");
		}
	}
}
