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

/*
 * @(#)dbMetaClient9.java	1.18 02/01/12
 */

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

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

public class dbMetaClient9 extends ServiceEETest implements Serializable 
{		  
	private static final String testName = "jdbc.ee.dbMeta.dbMeta9";
		
	//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) 
	{
		dbMetaClient9 theTests = new dbMetaClient9();
		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('=');
				sCatalogName = dbName.substring(nLocdbname +1);
				sCatalogName = sCatalogName.trim();
				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:         testGetTypeInfo
	 * @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 getTypeInfo() method must return a ResultSet object with each
	 *                    row is a description of a local DBMS type.  (See JDK 1.2.2 API 
	 *                    documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the getTypeInfo() method on that object.
	 *                    It should return a ResultSet object
	 *		      Validate the column names and column ordering.
	 */
	public void testGetTypeInfo() throws Fault 
	{
		try 
		{
			ResultSetMetaData rsmd=null;					
			String sColumnNames[]={"TYPE_NAME","DATA_TYPE","PRECISION","LITERAL_PREFIX","LITERAL_SUFFIX","CREATE_PARAMS","NULLABLE","CASE_SENSITIVE","SEARCHABLE","UNSIGNED_ATTRIBUTE","FIXED_PREC_SCALE","AUTO_INCREMENT","LOCAL_TYPE_NAME","MINIMUM_SCALE","MAXIMUM_SCALE","SQL_DATA_TYPE","SQL_DATETIME_SUB","NUM_PREC_RADIX" };  
			boolean statusColumnMatch=true;
			boolean statusColumnCount=true;					
			String sRetStr = new String();
			sRetStr = "";
				
			int iColumnNamesLength=sColumnNames.length;					
			logMsg("Calling DatabaseMetaData.getTypeInfo");
			
			//invoke getTypeInfo method
			ResultSet oRet_ResultSet = dbmd.getTypeInfo();
			
			// Store all the Type names returned
			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("Columns return are not same either in order or name");
				throw new Fault("Call to getTypeInfo Failed!");
			}

			// Store all the Type names returned
			while(oRet_ResultSet.next())
				sRetStr += oRet_ResultSet.getString(1) + ",";
			if(sRetStr == "")
				logMsg("getTypeInfo did not return any type names");
			else
				logMsg("The Type names returned are : " + sRetStr);
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to getTypeInfo is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to getTypeInfo is Failed!", e);
		}
	}

	/*
	 * @testName:         testSupportsResultSetType1
	 * @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 supportsResultSetType(int resType) method must return a 
	 *                    boolean value where resType can be any one of the following
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE.
	 *                    The value is true if the database supports the ResultSet type 
	 *                    resType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetType(int resType) method with Type TYPE_FORWARD_ONLY
	 *                    on that object.It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetType1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetType(TYPE_FORWARD_ONLY)");
			//invoke supportsResultSetType method
			boolean retValue = dbmd.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY);
			if(retValue)
				logMsg("TYPE_FORWARD_ONLY ResultSetType is supported");
			else
				logMsg("TYPE_FORWARD_ONLY ResultSetType is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetType1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetType1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetType2
	 * @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 supportsResultSetType(int resType) method must return a 
	 *                    boolean value where resType can be any one of the following
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE.
	 *                    The value is true if the database supports the ResultSet type 
	 *                    resType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetType() method with Type TYPE_SCROLL_INSENSITIVE
	 *                    on that object.It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetType2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetType(TYPE_SCROLL_INSENSITIVE)");
			//invoke supportsResultSetType method
			boolean retValue = dbmd.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if(retValue)
				logMsg("TYPE_SCROLL_INSENSITIVE ResultSetType is supported");
			else
			{
				logMsg("TYPE_SCROLL_INSENSITIVE ResultSetType is not supported");
			}
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetType2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetType2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetType3
	 * @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 supportsResultSetType(int resType) method must return a 
	 *                    boolean value where resType can be any one of the following
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE.
	 *                    The value is true if the database supports the ResultSet type 
	 *                    resType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetType() method with Type TYPE_SCROLL_SENSITIVE
	 *                    on that object.It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetType3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetType(TYPE_SCROLL_SENSITIVE)");
			//invoke supportsResultSetType method
			boolean retValue = dbmd.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE);
			if(retValue)
				logMsg("TYPE_SCROLL_SENSITIVE ResultSetType is supported");
			else
				logMsg("TYPE_SCROLL_SENSITIVE ResultSetType is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetType3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetType3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency1
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_FORWARD_ONLY and CONCUR_READ_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_READ_ONLY)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_READ_ONLY) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_READ_ONLY) is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency2
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_FORWARD_ONLY and CONCUR_UPDATABLE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_UPDATABLE)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_UPDATABLE) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_FORWARD_ONLY, CONCUR_UPDATABLE) is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency3
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY) is not supported");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency4
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_SCROLL_INSENSITIVE and CONCUR_UPDATABLE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency4() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_UPDATABLE)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_UPDATABLE) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_INSENSITIVE, CONCUR_UPDATABLE) is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency4 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency4 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency5
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_SCROLL_SENSITIVE and CONCUR_READ_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency5() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_READ_ONLY)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_READ_ONLY) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_READ_ONLY) is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency5 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency5 is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsResultSetConcurrency6
	 * @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 supportsResultSetConcurrency(int rsType, int rsConcur) 
	 *                    method must return a boolean value where possible values for rsType
	 *                    TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE & TYPE_SCROLL_SENSITIVE 
	 *                    and values for rsConcur can be CONCUR_READ_ONLY and
	 *                    CONCUR_UPDATABLE. The method returns true if the database 
	 *                    supports the concurrency level rsConcur with the combination
	 *                    of rsType and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get a DatabaseMetadata object from the connection to the database
	 *                    and call the supportsResultSetConcurrency(int resType, int rsConcur)
	 *                    method on that object with TYPE_SCROLL_SENSITIVE and CONCUR_UPDATABLE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsResultSetConcurrency6() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE)");
			//invoke supportsResultSetConcurrency method
			boolean retValue = dbmd.supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
			if(retValue)
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE) is supported");
			else
				logMsg("supportsResultSetConcurrency(TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE) is not supported");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency6 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to supportsResultSetConcurrency6 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnUpdatesAreVisible1
	 * @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 ownUpdatesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own updates are
	 *                    visible without having to close and reopen the result set 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 ownUpdatesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnUpdatesAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownUpdatesAreVisible(TYPE_FORWARD_ONLY)");
			//invoke ownUpdatesAreVisible method
			boolean retValue = dbmd.ownUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if(retValue)
				logMsg("Result Set's own updates are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Result Set's own updates are not visible for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnUpdatesAreVisible2
	 * @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 ownUpdatesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own updates are
	 *                    visible without having to close and reopen the result set 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 ownUpdatesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnUpdatesAreVisible2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownUpdatesAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke ownUpdatesAreVisible method
			boolean retValue = dbmd.ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if(retValue)
				logMsg("Result Set's own updates are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Result Set's own updates are not visible for TYPE_SCROLL_INSENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnUpdatesAreVisible3
	 * @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 ownUpdatesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own updates are
	 *                    visible without having to close and reopen the result set 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 ownUpdatesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnUpdatesAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownUpdatesAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke ownUpdatesAreVisible method
			boolean retValue = dbmd.ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if(retValue)
				logMsg("Result Set's own updates are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Result Set's own updates are not visible for TYPE_SCROLL_SENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownUpdatesAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnDeletesAreVisible1
	 * @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 ownDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own deletions are
	 *                    visible without having to close and reopen the result set 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 ownDeletesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnDeletesAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownDeletesAreVisible(TYPE_FORWARD_ONLY)");
			//invoke ownDeletesAreVisible method
			boolean retValue = dbmd.ownDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if(retValue)
				logMsg("Result Set's own deletes are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Result Set's own deletes are not visible for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownDeletesAreVisible1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownDeletesAreVisible1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnDeletesAreVisible2
	 * @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 ownDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own deletions are
	 *                    visible without having to close and reopen the result set 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 ownDeletesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnDeletesAreVisible2() throws Fault 
	{
		try
		{
			logMsg("Calling DatabaseMetaData.ownDeletesAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke ownDeletesAreVisible method
			boolean retValue = dbmd.ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if(retValue)
				logMsg("Result Set's own deletes are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Result Set's own deletes are not visible for TYPE_SCROLL_INSENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownDeletesAreVisible2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownDeletesAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnDeletesAreVisible3
	 * @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 ownDeletesAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own deletions are
	 *                    visible without having to close and reopen the result set 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 ownDeletesAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnDeletesAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownDeletesAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke ownDeletesAreVisible method
			boolean retValue = dbmd.ownDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if(retValue)
				logMsg("Result Set's own deletes are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Result Set's own deletes are not visible for TYPE_SCROLL_SENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownDeletesAreVisible3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownDeletesAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnInsertsAreVisible1
	 * @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 ownInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own insertions are
	 *                    visible without having to close and reopen the result set 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 ownInsertsAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnInsertsAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownInsertsAreVisible(TYPE_FORWARD_ONLY)");
			//invoke ownInsertsAreVisible method
			boolean retValue = dbmd.ownInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if(retValue)
				logMsg("Result Set's own inserts are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Result Set's own inserts are not visible for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownInsertsAreVisible1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownInsertsAreVisible1 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnInsertsAreVisible2
	 * @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 ownInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own insertions are
	 *                    visible without having to close and reopen the result set 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 ownInsertsAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_INSENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnInsertsAreVisible2() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownInsertsAreVisible(TYPE_SCROLL_INSENSITIVE)");
			//invoke ownInsertsAreVisible method
			boolean retValue = dbmd.ownInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE);
			if(retValue)
				logMsg("Result Set's own inserts are visible for TYPE_SCROLL_INSENSITIVE");
			else
				logMsg("Result Set's own inserts are not visible for TYPE_SCROLL_INSENSITIVE");
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownInsertsAreVisible2 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownInsertsAreVisible2 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOwnInsertsAreVisible3
	 * @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 ownInsertsAreVisible(int resType) method must return a 
	 *                    boolean value; true if a ResultSet object's own insertions are
	 *                    visible without having to close and reopen the result set 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 ownInsertsAreVisible(int resType) method on that object
	 *                    with ResultSet.TYPE_SCROLL_SENSITIVE.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOwnInsertsAreVisible3() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.ownInsertsAreVisible(TYPE_SCROLL_SENSITIVE)");
			//invoke ownInsertsAreVisible method
			boolean retValue = dbmd.ownInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE);
			if(retValue)
				logMsg("Result Set's own inserts are visible for TYPE_SCROLL_SENSITIVE");
			else
				logMsg("Result Set's own inserts are not visible for TYPE_SCROLL_SENSITIVE");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to ownInsertsAreVisible3 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to ownInsertsAreVisible3 is Failed!", e);
		}
	}


	/*
	 * @testName:         testOthersUpdatesAreVisible1
	 * @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_FORWARD_ONLY.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testOthersUpdatesAreVisible1() throws Fault 
	{
		try 
		{
			logMsg("Calling DatabaseMetaData.othersUpdatesAreVisible(TYPE_FORWARD_ONLY)");
			//invoke othersUpdatesAreVisible method
			boolean retValue = dbmd.othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY);
			if(retValue)
				logMsg("Updates made by others are visible for TYPE_FORWARD_ONLY");
			else
				logMsg("Updates made by others are not visible for TYPE_FORWARD_ONLY");
		}
		catch ( SQLException sqle )
		{
			logErr("SQL Exception " + sqle.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible1 is Failed!", sqle);
		}
		catch ( Exception e ) 
		{
			logErr("Unexpected Exception " + e.getMessage());
			throw new Fault("Call to othersUpdatesAreVisible1 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");
		}
	}
}
