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

/*
 * @(#)callStmtClient4.java	1.8 02/01/12
 */

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

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 callStmtClient4 class tests methods of DatabaseMetaData interface using
 * Sun's J2EE Reference Implementation.
 * @author
 * @version 1.7, 06/16/99
 */

public class callStmtClient4 extends ServiceEETest implements Serializable
{
	private static final String testName = "jdbc.ee.callStmt.callStmt4";
	//Naming specific member variables
	private CTSNamingContextInterface jc = null;


	//Harness requirements
	private transient Connection conn = 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)
	{
		callStmtClient4 theTests = new callStmtClient4();
		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();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception : " + ex.getMessage());
			}
		}
		catch  ( Exception e )
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}


	/*
	 * @testName:         testGetObject21
	 * @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 Time value from Time_Tab.Extract the same Time 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 testGetObject21() throws Fault
	{
		Time oRetVal = null;
		Time nonNullTimeVal = null;
		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Time_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIME);
			cstmt.registerOutParameter(2,java.sql.Types.TIME);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Time.BreakTime)");
			
			//invoke getObject method
			oRetVal = (Time)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Time_Tab",1,sqlp,conn);
			sRetStr=sRetStr.substring(sRetStr.indexOf('\'')+1, sRetStr.lastIndexOf('\''));
			nonNullTimeVal = Time.valueOf(sRetStr);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + nonNullTimeVal);
			
			if(oRetVal.equals(nonNullTimeVal))
				logMsg("getObject returns the Break Time for type Time " + oRetVal);
			else
			{
				logErr("getObject did not return the proper Break Time for type Time");
				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("Time_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject22
	 * @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 Time_Tab.Check if it returns null
	 */
	public void testGetObject22() throws Fault
	{
		try
		{
			rsSch.createTab("Time_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Time_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIME);
			cstmt.registerOutParameter(2,java.sql.Types.TIME);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Time.NullValue)");
			
			//invoke getObject method
			Time oRetVal = (Time)cstmt.getObject(2);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal==null)
				logMsg("getObject returns the null value for type Time " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type Time");
				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("Time_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject23
	 * @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 Timestamp value from Timestamp_Tab.Extract the same Timestamp 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 testGetObject23() throws Fault
	{
		Timestamp oRetVal = null;
		Timestamp nonNullTimestampVal = null;
		try
		{
			rsSch.createTab("Timestamp_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Timestamp_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIMESTAMP);
			cstmt.registerOutParameter(2,java.sql.Types.TIMESTAMP);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Timestamp.InTime)");
			
			//invoke getObject method
			oRetVal = (Timestamp)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Timestamp_Tab",1,sqlp,conn);
			sRetStr=sRetStr.substring(sRetStr.indexOf('\'')+1, sRetStr.lastIndexOf('\''));
			nonNullTimestampVal = Timestamp.valueOf(sRetStr);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + nonNullTimestampVal);
			
			if(oRetVal.equals(nonNullTimestampVal))
				logMsg("getObject returns the In Time for type Timestamp " + oRetVal);
			else
			{
				logErr("getObject did not return the proper In Time for type Timestamp");
				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("Timestamp_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject24
	 * @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 Timestamp_Tab.Check if it returns null
	 */
	public void testGetObject24() throws Fault
	{
		try
		{
			rsSch.createTab("Timestamp_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Timestamp_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TIMESTAMP);
			cstmt.registerOutParameter(2,java.sql.Types.TIMESTAMP);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Timestamp.NullValue)");
			
			//invoke getObject method
			Timestamp oRetVal = (Timestamp)cstmt.getObject(2);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal==null)
				logMsg("getObject returns the null value for type Timestamp " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type Timestamp");
				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("Timestamp_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject25
	 * @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 Date value from from Date_Tab.Extract the Date 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 testGetObject25() throws Fault
	{
		java.sql.Date oRetVal = null;
		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Date_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DATE);
			cstmt.registerOutParameter(2,java.sql.Types.DATE);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Date.DateValue)");
			
			//invoke getObject method
			oRetVal = (java.sql.Date)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Date_Tab",1,sqlp,conn);
			sRetStr=sRetStr.substring(sRetStr.indexOf('\'')+1, sRetStr.lastIndexOf('\''));
			sRetStr=sRetStr.trim();
			java.sql.Date oExtVal = java.sql.Date.valueOf(sRetStr);
			logMsg("sRetStr="+sRetStr+" oRetVal="+oRetVal.toString());
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);
			
			if(oRetVal.toString().equals(oExtVal.toString()))
				logMsg("getObject returns the proper Date for type Date " + oRetVal);
			else
			{
				logErr("getObject did not return the proper Date for type Date");
				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("Date_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject26
	 * @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 Date_Tab.Check if it returns null
	 */
	public void testGetObject26() throws Fault
	{
		try
		{
			rsSch.createTab("Date_Tab",sqlp,conn);
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Date_Proc(?,?)}");
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DATE);
			cstmt.registerOutParameter(2,java.sql.Types.DATE);


			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Date.NullValue)");
			//invoke getObject method
			java.sql.Date oRetVal = (java.sql.Date)cstmt.getObject(2);
			logMsg("Value retrieved using cstmt	:" + oRetVal);


			if(oRetVal==null)
				logMsg("getObject returns the null value for type Date " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type Date");
				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("Date_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject27
	 * @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 Tinyint_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 testGetObject27() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(2,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(3,java.sql.Types.TINYINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Byte.MaximumValue(JDBC TINYINT))");
			
			//invoke getObject method
			Object obj = cstmt.getObject(1);
			Byte oRetVal = new Byte(obj.toString());
			
			String sRetStr = rsSch.extractVal("Tinyint_Tab",1,sqlp,conn);
			Byte oExtVal = new Byte(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 TINYINT " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum Value for type TINYINT ");
				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("Tinyint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject28
	 * @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 Tinyint_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 testGetObject28() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(2,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(3,java.sql.Types.TINYINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Byte.MinimumValue(JDBC TINYINT))");
			
			//invoke getObject method
			Object obj = cstmt.getObject(2);
			Byte oRetVal = new Byte(obj.toString());
			
			String sRetStr = rsSch.extractVal("Tinyint_Tab",2,sqlp,conn);
			Byte oExtVal = new Byte(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 TINYINT " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum Value for type TINYINT ");
				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("Tinyint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject29
	 * @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 Tinyint_Tab.Check if it returns null
	 */
	public void testGetObject29() throws Fault
	{
		try
		{
			rsSch.createTab("Tinyint_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Tinyint_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(2,java.sql.Types.TINYINT);
			cstmt.registerOutParameter(3,java.sql.Types.TINYINT);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Byte.NullValue(JDBC TINYINT))");
			
			//invoke getObject method
			Object oRetVal = cstmt.getObject(3);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal == null)
				logMsg("getObject returns the Null Value for type Byte(JDBC TINYINT) " + oRetVal);
			else
			{
				logErr("getObject did not return the Null Value for type Byte(JDBC TINYINT)");
				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("Tinyint_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject30
	 * @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 Double_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 testGetObject30() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(2,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(3,java.sql.Types.DOUBLE);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Double.MaximumValue (JDBC DOUBLE))");
			
			//invoke getObject method
			Double oRetVal = (Double)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Double_Tab",1,sqlp,conn);
			Double oExtVal = new Double(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 Double(JDBC DOUBLE) " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum Value for type Double(JDBC DOUBLE)");
				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("Double_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject31
	 * @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 Double_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 testGetObject31() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(2,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(3,java.sql.Types.DOUBLE);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Double.MinimumValue(JDBC DOUBLE))");
			
			//invoke getObject method
			Double oRetVal = (Double)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Double_Tab",2,sqlp,conn);
			Double oExtVal = new Double(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 Double(JDBC DOUBLE) " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum Value for type Double(JDBC DOUBLE)");
				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("Double_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject32
	 * @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 Double_Tab.Check if it returns null
	 */
	public void testGetObject32() throws Fault
	{
		try
		{
			rsSch.createTab("Double_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Double_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(2,java.sql.Types.DOUBLE);
			cstmt.registerOutParameter(3,java.sql.Types.DOUBLE);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Double.NullValue(JDBC DOUBLE))");
			
			//invoke getObject method
			Double oRetVal = (Double)cstmt.getObject(3);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal ==null)
				logMsg("getObject returns the Null Value for type Double(JDBC DOUBLE) " + oRetVal);
			else
			{
				logErr("getObject did not return the Null Value for type Double(JDBC DOUBLE)");
				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("Double_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject33
	 * @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 Real_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 testGetObject33() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Real_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.REAL);
			cstmt.registerOutParameter(2,java.sql.Types.REAL);
			cstmt.registerOutParameter(3,java.sql.Types.REAL);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Float.MaximumValue)");
			
			//invoke getObject method
			Float oRetVal = (Float)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Real_Tab",1,sqlp,conn);
			Float oExtVal = new Float(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 Float " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum Value for type 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("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject34
	 * @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 Real_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 testGetObject34() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Real_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.REAL);
			cstmt.registerOutParameter(2,java.sql.Types.REAL);
			cstmt.registerOutParameter(3,java.sql.Types.REAL);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Float.MinimumValue)");
			
			//invoke getObject method
			Float oRetVal = (Float)cstmt.getObject(2);
			String sRetStr = rsSch.extractVal("Real_Tab",2,sqlp,conn);
			Float oExtVal = new Float(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 Float " + oRetVal);
			else
			{
				logErr("getObject did not return the Minimum Value for type 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("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject35
	 * @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 Real_Tab.Check if it returns null
	 */
	public void testGetObject35() throws Fault
	{
		try
		{
			rsSch.createTab("Real_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Real_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.REAL);
			cstmt.registerOutParameter(2,java.sql.Types.REAL);
			cstmt.registerOutParameter(3,java.sql.Types.REAL);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(Float.NullValue)");
			
			//invoke getObject method
			Float oRetVal = (Float)cstmt.getObject(3);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal ==null)
				logMsg("getObject returns the Null Value for type Float " + oRetVal);
			else
			{
				logErr("getObject did not return the Null Value for type 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("Real_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject36
	 * @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 Varchar value from Varchar_Tab.Extract the same Varchar 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 testGetObject36() throws Fault
	{
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varchar_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARCHAR);
			cstmt.registerOutParameter(2,java.sql.Types.VARCHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.Name(JDBC VARCHAR))");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(1);
			String oExtVal = rsSch.extractVal("Varchar_Tab",1,sqlp,conn);
			oExtVal=oExtVal.trim();
			oRetVal=oRetVal.trim();
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);
			
			if(oRetVal.equals(oExtVal.substring(1,oExtVal.length()-1)))
				logMsg("getObject returns the Name for type String(JDBC VARCHAR) " + oRetVal);
			else
			{
				logErr("getObject did not return the Name for type String(JDBC VARCHAR)");
				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("Varchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject37
	 * @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 Varchar_Tab.Check if it returns null
	 */
	public void testGetObject37() throws Fault
	{
		try
		{
			rsSch.createTab("Varchar_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Varchar_Proc(?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.VARCHAR);
			cstmt.registerOutParameter(2,java.sql.Types.VARCHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.NullValue(JDBC VARCHAR))");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(2);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal ==  null)
				logMsg("getObject returns the null value for type String(JDBC VARCHAR) " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type String(JDBC VARCHAR)");
				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("Varchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject38
	 * @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 Longvarchar value from Longvarchar_Tab.Extract the same Longvarchar 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 testGetObject38() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarchar_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Longvarchar_Proc(?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.LONGVARCHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.Name(JDBC LONGVARCHAR))");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(1);
			String oExtVal = rsSch.extractVal("Longvarchar_Tab",1,sqlp,conn);
			oExtVal=oExtVal.trim();
			oRetVal=oRetVal.trim();
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			logMsg("Value extracted from ctsql.stmt	:" + oExtVal);
			
			if(oRetVal.equals(oExtVal.substring(1,oExtVal.length()-1)))
				logMsg("getObject returns the Name for type String(JDBC LONGVARCHAR) " + oRetVal);
			else
			{
				logErr("getObject did not return the Name for type String(JDBC LONGVARCHAR)");
				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("Longvarchar_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject39
	 * @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 Longvarchar_Tab.Check if it returns null
	 */
	public void testGetObject39() throws Fault
	{
		try
		{
			rsSch.createTab("Longvarcharnull_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Longvarcharnull_Proc(?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.LONGVARCHAR);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(String.NullValue(JDBC LONGVARCHAR))");
			
			//invoke getObject method
			String oRetVal = (String)cstmt.getObject(1);
			logMsg("Value retrieved using cstmt	:" + oRetVal);
			
			if(oRetVal ==  null)
				logMsg("getObject returns the null value for type String(JDBC LONGVARCHAR) " + oRetVal);
			else
			{
				logErr("getObject did not return the null value for type String(JDBC LONGVARCHAR)");
				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("Longvarcharnull_Tab",conn);
			}catch (Exception e) {};
		}
	}


	/*
	 * @testName:         testGetObject40
	 * @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 Decimal_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 testGetObject40() throws Fault
	{
		try
		{
			rsSch.createTab("Decimal_Tab",sqlp,conn);
			
			// get the CallableStatement object
			cstmt = conn.prepareCall("{call Decimal_Proc(?,?,?)}");
			
			//register the output parameters
			cstmt.registerOutParameter(1,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(2,java.sql.Types.DECIMAL,15);
			cstmt.registerOutParameter(3,java.sql.Types.DECIMAL,15);
			
			//execute the procedure
			cstmt.execute();
			logMsg("Calling CallableStatement.getObject(BigDecimal.MaximumValue(JDBC DECIMAL))");
			
			//invoke getObject method
			BigDecimal oRetVal = (BigDecimal)cstmt.getObject(1);
			String sRetStr = rsSch.extractVal("Decimal_Tab",1,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 Maximum value for type BigDecimal(JDBC DECIMAL) " + oRetVal);
			else
			{
				logErr("getObject did not return the Maximum value for type BigDecimal(JDBC DECIMAL)");
				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("Decimal_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");
		}
	}
}
