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

/*
 * @(#)dbMetaClient10.java	1.23 02/01/12
 */

package com.sun.cts.tests.jdbc.ee.dbMeta.dbMeta10;

import java.io.*;
import java.util.*;

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

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

	//Harness requirements 

	private transient Connection conn = null;
	private transient DatabaseMetaData dbmd = null;	 
	private DataSource ds1 = null;
	private dbSchema dbSch=null;
	private	String dbName=null,dbUser=null,drManager=null;
	private String sCatalogName=null,sSchemaName=null,sPtable=null,sFtable=null;


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

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

				int nLocdbname = dbName.indexOf('=');
				sSchemaName = dbUser;

				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);
				}
				dbSch = new dbSchema();
				dbSch.createData(p,conn);
				dbmd=conn.getMetaData();
			}
			catch(SQLException ex)
			{
				logErr("SQL Exception : " + ex.getMessage());
			}
		}
		catch ( Exception e ) 
		{
			logErr("Setup Failed!");
			TestUtil.printStackTrace(e);
		}
	}


	/*
	 * @testName:         testOthersUpdatesAreVisible2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersUpdatesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows updated by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherUpdatesAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersUpdatesAreVisible2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersUpdatesAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke othersUpdatesAreVisible method
			boolean retValue = dbmd.othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if(retValue)
				logMsg("Updates made by others are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Updates made by others are not visible for TYPE_SCROLL_INSENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersUpdatesAreVisible3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersUpdatesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows updated by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherUpdatesAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersUpdatesAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersUpdatesAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke othersUpdatesAreVisible method
			boolean retValue = dbmd.othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Updates made by others are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Updates made by others are not visible for TYPE_SCROLL_SENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersDeletesAreVisible1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows deleted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherDeletesAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersDeletesAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersDeletesAreVisible(TYPE_FORWARD_ONLY)");
			//invoke othersDeletesAreVisible method
			boolean retValue = dbmd.othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if (retValue)
				logMsg("Deletes made by others are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Deletes made by others are not visible for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersDeletesAreVisible1 is Failed!", sqle );
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersDeletesAreVisible1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersDeletesAreVisible2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows deleted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherDeletesAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersDeletesAreVisible2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersDeletesAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke othersDeletesAreVisible method
			boolean retValue = dbmd.othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if (retValue)
				logMsg("Deletes made by others are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Deletes made by others are not visible for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersDeletesAreVisible2 is Failed!", sqle );
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersDeletesAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersDeletesAreVisible3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows deleted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherDeletesAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersDeletesAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersDeletesAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke othersDeletesAreVisible method
			boolean retValue = dbmd.othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Deletes made by others are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Deletes made by others are not visible for TYPE_SCROLL_SENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersDeletesAreVisible3 is Failed!", sqle );
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersDeletesAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersInsertsAreVisible1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows inserted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherInsertsAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersInsertsAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersInsertsAreVisible(TYPE_FORWARD_ONLY)");
			//invoke othersInsertsAreVisible method
			boolean retValue = dbmd.othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if (retValue)
				logMsg("Inserts made by others are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Inserts made by others are not visible for TYPE_FORWARD_ONLY");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersInsertsAreVisible1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersInsertsAreVisible1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersInsertsAreVisible2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows inserted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherInsertsAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersInsertsAreVisible2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersInsertsAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke othersInsertsAreVisible method
			boolean retValue = dbmd.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if (retValue)
				logMsg("Inserts made by others are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Inserts made by others are not visible for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersInsertsAreVisible2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersInsertsAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersInsertsAreVisible3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The othersInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a rows inserted by others are visible and
	 *                    false otherwise. The possible values for resType are
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the otherInsertsAreVisible(int resType) method on that 
	 *                    object with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersInsertsAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersInsertsAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke othersInsertsAreVisible method
			boolean retValue = dbmd.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Inserts made by others are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Inserts made by others are not visible for TYPE_SCROLL_SENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersInsertsAreVisible3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersInsertsAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testUpdatesAreDetected1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The updatesAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowUpdated returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row updates; false if the method 
	 *                    ResultSet.rowUpdated returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the updatesAreDetected() method on that object with the
	 *                    ResultSet Type as ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testUpdatesAreDetected1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.updatesAreDetected(TYPE_FORWARD_ONLY)");
			//invoke updatesAreDetected method
			boolean retValue = dbmd.updatesAreDetected(ResultSet.TYPE_FORWARD_ONLY);
			if (retValue)
				logMsg("Visible row update can be detected for TYPE_FORWARD_ONLY");
			else
				logMsg("Visible row update cannot be detected for TYPE_FORWARD_ONLY");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to updatesAreDetected1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to updatesAreDetected1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testUpdatesAreDetected2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The updatesAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowUpdated returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row updates; false if the method 
	 *                    ResultSet.rowUpdated returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the updatesAreDetected() method on that object with the
	 *                    ResultSet Type as ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testUpdatesAreDetected2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.updatesAreDetected(TYPE_SCROLL_INSENSITIVE)");
			//invoke updatesAreDetected method
			boolean retValue = dbmd.updatesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if (retValue)
				logMsg("Visible row update can be detected for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Visible row update cannot be detected for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to updatesAreDetected2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to updatesAreDetected2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testUpdatesAreDetected3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The updatesAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowUpdated returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row updates; false if the method 
	 *                    ResultSet.rowUpdated returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the updatesAreDetected() method on that object with the
	 *                    ResultSet Type as ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testUpdatesAreDetected3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.updatesAreDetected(TYPE_SCROLL_SENSITIVE)");
			//invoke updatesAreDetected method
			boolean retValue = dbmd.updatesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Visible row update can be detected for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Visible row update cannot be detected for TYPE_SCROLL_SENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to updatesAreDetected3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to updatesAreDetected3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testDeletesAreDetected1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The deletesAreDetected(int resType) method must return a 
	 *                    boolean value; true if changes are detected by the resultset type
	 *                    and false otherwise. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the deletesAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testDeletesAreDetected1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.deletesAreDetected(TYPE_FORWARD_ONLY)");
			//invoke deletesAreDetected method
			boolean retValue = dbmd.deletesAreDetected(ResultSet.TYPE_FORWARD_ONLY);
			if (retValue)
				logMsg("Visible row delete can be detected for TYPE_FORWARD_ONLY");
			else
				logMsg("Visible row delete cannot be detected for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to deletesAreDetected1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to deletesAreDetected1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testDeletesAreDetected2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The deletesAreDetected(int resType) method must return a 
	 *                    boolean value; true if changes are detected by the resultset type
	 *                    and false otherwise. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the deletesAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testDeletesAreDetected2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.deletesAreDetected(TYPE_SCROLL_INSENSITIVE)");
			//invoke deletesAreDetected method
			boolean retValue = dbmd.deletesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if (retValue)
				logMsg("Visible row delete can be detected for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Visible row delete cannot be detected for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to deletesAreDetected2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to deletesAreDetected2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testDeletesAreDetected3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The deletesAreDetected(int resType) method must return a 
	 *                    boolean value; true if changes are detected by the resultset type
	 *                    and false otherwise. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the deletesAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testDeletesAreDetected3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.deletesAreDetected(TYPE_SCROLL_SENSITIVE)");
			//invoke deletesAreDetected method
			boolean retValue = dbmd.deletesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Visible row delete can be detected for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Visible row delete cannot be detected for TYPE_SCROLL_SENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to deletesAreDetected3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to deletesAreDetected3 Failed!", e);
		}
	}


	/*
	 * @testName:         testInsertsAreDetected1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The insertsAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowInserted returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row insertion; false if the method 
	 *                    ResultSet.rowInserted returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the insertsAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either or false.
	 *
	 */
	public void testInsertsAreDetected1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.insertsAreDetected(TYPE_FORWARD_ONLY)");
			//invoke insertsAreDetected method
			boolean retValue = dbmd.insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY);
			if (retValue)
				logMsg("Visible row insert can be detected for TYPE_FORWARD_ONLY");
			else
				logMsg("Visible row insert cannot be detected for TYPE_FORWARD_ONLY");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to insertsAreDetected1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to insertsAreDetected1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testInsertsAreDetected2
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The insertsAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowInserted returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row insertion; false if the method 
	 *                    ResultSet.rowInserted returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the insertsAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either or false.
	 *
	 */
	public void testInsertsAreDetected2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.insertsAreDetected(TYPE_SCROLL_INSENSITIVE)");
			//invoke insertsAreDetected method
			boolean retValue = dbmd.insertsAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if (retValue)
				logMsg("Visible row insert can be detected for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Visible row insert cannot be detected for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to insertsAreDetected2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{ 
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to insertsAreDetected2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testInsertsAreDetected3
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The insertsAreDetected(int resType) method must return a 
	 *                    boolean value; true if the method ResultSet.rowInserted returns
	 *                    true when called on a ResultSet object with a given type that
	 *                    contains visible row insertion; false if the method 
	 *                    ResultSet.rowInserted returns false. The possible values for
	 *                    resType are TYPE_FORWARD_ONLY, TYPE_SCROLL_SENSITIVE and
	 *                    TYPE_SCROLL_INSENSITIVE.(See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the insertsAreDetected() method on that object with the
	 *                    result set type as ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either or false.
	 *
	 */
	public void testInsertsAreDetected3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.insertsAreDetected(TYPE_SCROLL_SENSITIVE)");
			//invoke insertsAreDetected method
			boolean retValue = dbmd.insertsAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE);
			if (retValue)
				logMsg("Visible row insert can be detected for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Visible row insert cannot be detected for TYPE_SCROLL_SENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to insertsAreDetected3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to insertsAreDetected3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testGetUDTs
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The getUDTs() method must return a ResultSet object with each 
	 *                    row is a description of a UDT (User Defined Type).
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the getUDTs() method on that object.
	 *                    It should return a ResultSet object.
	 *		      Validate the column names and column ordering.
	 */
	public void testGetUDTs() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.getUDTs");
			//invoke getUDTs method
			ResultSet oRet_ResultSet = dbmd.getUDTs(sCatalogName,sSchemaName,"%",null);
			String sRetStr = new String();
			sRetStr = "";
			// Store all the type names returned
			while(oRet_ResultSet.next())
				sRetStr += oRet_ResultSet.getString(3) + ",";
			if(sRetStr == "")
				logMsg("getUDTs did not return any user defined types");
			else
				logMsg("The type names returned Are : " + sRetStr.substring(0,sRetStr.length() - 1));
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getUDTs is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getUDTs Failed!", e);
		}
	}


	/*
	 * @testName:         testGetUDTs01
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The getUDTs() method must return a ResultSet object with each 
	 *                    row is a description of a UDT (User Defined Type).
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the getUDTs() method on that object.
	 *                    It should return a ResultSet object.
	 *		      Validate the column names and column ordering.
	 *
	 */
	public void testGetUDTs01() throws Fault 
	{
		try 
		{
			ResultSetMetaData rsmd=null;					
			String sColumnNames[]={"TYPE_CAT","TYPE_SCHEM","TYPE_NAME","CLASS_NAME","DATA_TYPE","REMARKS"};  
			boolean statusColumnMatch=true;
			boolean statusColumnCount=true;
								
			String sRetStr = new String();
			sRetStr = "";
				
			int iColumnNamesLength=sColumnNames.length;					
			logMsg("Calling DatabaseMetaData.getUDTs");
			
			//invoke getUDTs method
			ResultSet oRet_ResultSet = dbmd.getUDTs(sCatalogName,sSchemaName,"%",null);
			rsmd = oRet_ResultSet.getMetaData();				
			
			int iCount= rsmd.getColumnCount();				
			
			logMsg("Minimum Column Count is:" + iColumnNamesLength);					
				
			// Comparing Column Lengths
			if ( iColumnNamesLength > iCount )
				statusColumnCount=false;
			else if ( iColumnNamesLength < iCount )
			{
				iCount=iColumnNamesLength;
				statusColumnCount=true;		
			}
			else
				statusColumnCount=true;
			
			logMsg("Comparing Column Names...");
			
			while( iColumnNamesLength > 0)						
			{
				if ( sColumnNames[iColumnNamesLength-1].equalsIgnoreCase(rsmd.getColumnName(iCount)) )
				{
						statusColumnMatch=true;		
				}
				else
				{
						statusColumnMatch=false;
						break;
				}
				iCount--;
				iColumnNamesLength--;
			}								

			if( (statusColumnMatch==false) && (statusColumnCount==true) ) 
			{			
				logMsg("Column names or order wrong.");
				throw new Fault("Call to getUDTs Failed!");
			}
			
			// Store all the type names returned
			while(oRet_ResultSet.next())
				sRetStr += oRet_ResultSet.getString(3) + ",";
			if(sRetStr == "")
				logMsg("getUDTs did not return any user defined types");
			else
				logMsg("The type names returned Are : " + sRetStr.substring(0,sRetStr.length() - 1));
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getUDTs Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getUDTs Failed!", e);
		}
	}



	/*
	 * @testName:         testSupportsTransactionIsolationLevel1
	 * @assertion:        The DatabaseMetaData provides information about the database.
	 *                    (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
	 *                     
	 *                    A  driver must provide full support for DatabaseMetaData and 
	 *                    ResultSetMetaData.  This implies that all of the methods in the 
	 *                    DatabaseMetaData interface must be implemented and must behave as 
	 *                    specified in the JDBC 1.0 and 2.0 specifications.  None of the 
	 *                    methods in DatabaseMetaData and ResultSetMetaData may throw an 
	 *                    exception because they are not implemented. (See section 6.2.2.3 
	 *                    of Java2 Platform Enterprise Edition (J2EE) Specification v1.2)
	 *                    The supportsTransactionIsolationLevel(int isolevel) method must 
	 *                    return a boolean value; true if the database supports the given 
	 *                    Transaction Isolation Level isolevel and false otherwise.  The
	 *                    possible values for isolevel can be TRANSACTION_NONE,
	 *                    TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED,
	 *                    TRANSACTION_REPEATABLE_READ and TRANSACTION_SERIALIZABLE.
	 *                    (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsTransactionIsolationLevel(int isolevel) method
	 *                    on that object with the isolation level TRANSACTION_NONE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsTransactionIsolationLevel1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsTransactionIsolationLevel(TRANSACTION_NONE)");
			//invoke supportsTransactionIsolationLevel method
			boolean retValue = dbmd.supportsTransactionIsolationLevel(Connection.TRANSACTION_NONE);
			if (retValue)
				logMsg("supportsTransactionIsolationLevel(TRANSACTION_NONE) is supported");
			else
				logMsg("supportsTransactionIsolationLevel(TRANSACTION_NONE) is not supported");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsTransactionIsolationLevel1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsTransactionIsolationLevel1 is Failed!", e);
		}
	}


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