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

/*
 * @(#)dbMetaClient3.java	1.17 02/01/12
 */

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

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

public class dbMetaClient3 extends ServiceEETest implements Serializable 
{		  
	private static final String testName = "jdbc.ee.dbMeta.dbMeta3";
		
	//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) 
	{
		dbMetaClient3 theTests = new dbMetaClient3();
		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:         testSupportsConvert03
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(BINARY, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert03() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			boolean retValue = dbmd.supportsConvert(Types.BINARY, Types.VARCHAR);
			logMsg("Calling supportsConvert(BINARY, VARCHAR) on DatabaseMetaData");
			if(retValue)
			{
				logMsg("supportsConvert(BINARY, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(BINARY, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert04
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation).
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(BIT, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert04() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(BIT, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.BIT, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(BIT, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(BIT, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert05
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(BLOB, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert05() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(BLOB, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.BLOB, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(BLOB, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(BLOB, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert06
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(CHAR, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert06() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(CHAR, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.CHAR, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(CHAR, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(CHAR, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert07
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(CLOB, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert07() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(CLOB, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.CLOB, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(CLOB, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(CLOB, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert08
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(DATE, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert08() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(DATE, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.DATE, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(DATE, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(DATE, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert09
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(DECIMAL, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert09() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(DECIMAL, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.DECIMAL, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(DECIMAL, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(DECIMAL, VARCHAR) method is not supported");
			}
		} 
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert10
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation) 
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(DISTINCT, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert10() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(DISTINCT, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.DISTINCT, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(DISTINCT, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(DISTINCT, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert11
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(DOUBLE, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert11() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(DOUBLE, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.DOUBLE, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(DOUBLE, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(DOUBLE, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert12
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(FLOAT, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert12() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(FLOAT, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.FLOAT, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(FLOAT, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(FLOAT, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert13
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(INTEGER, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert13() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(INTEGER, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.INTEGER, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(INTEGER, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(INTEGER, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert14
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(JAVA_OBJECT, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert14() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(JAVA_OBJECT, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.JAVA_OBJECT, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(JAVA_OBJECT, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(JAVA_OBJECT, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert15
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(LONGVARBINARY, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert15() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(LONGVARBINARY, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.LONGVARBINARY, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(LONGVARBINARY, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(LONGVARBINARY, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert16
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(LONGVARCHAR, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert16() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(LONGVARCHAR, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.LONGVARCHAR, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(LONGVARCHAR, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(LONGVARCHAR, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert17
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(NULL, VARCHAR) on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert17() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(NULL, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.NULL, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(NULL, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(NULL, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert18
	 * @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 supportsConvert(int fromType, int toType) method must return
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(NUMERIC, VARCHAR) method on that object
	 *                    It should return a boolean value; either true or false
	 *
	 */
	public void testSupportsConvert18() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(NUMERIC, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.NUMERIC, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(NUMERIC, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(NUMERIC, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert19
	 * @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 supportsConvert(int fromType, int toType) method must return
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(OTHER, VARCHAR) method on that object
	 *                    It should return a boolean value; either true or false
	 *
	 */
	public void testSupportsConvert19() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			logMsg("Calling supportsConvert(OTHER, VARCHAR) on DatabaseMetaData");
			boolean retValue = dbmd.supportsConvert(Types.OTHER, Types.VARCHAR);
			if(retValue)
			{
				logMsg("supportsConvert(OTHER, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(OTHER, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert20
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(REAL, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert20() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			boolean retValue = dbmd.supportsConvert(Types.REAL, Types.VARCHAR);
			logMsg("Calling supportsConvert(REAL, VARCHAR) on DatabaseMetaData");
			if(retValue)
			{
				logMsg("supportsConvert(REAL, VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(REAL, VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert21
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(REF, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert21() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			boolean retValue = dbmd.supportsConvert(Types.REF, Types.VARCHAR);
			logMsg("Calling supportsConvert(REF, VARCHAR) on DatabaseMetaData");
			if(retValue)
			{
				logMsg("supportsConvert(REF VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(REF VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", e);
		}
	}


	/*
	 * @testName:         testSupportsConvert22
	 * @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 supportsConvert(int fromType, int toType) method must return 
	 *                    a boolean value; true if the database supports the scalar function
	 *                    CONVERT for conversions between the JDBC types fromType and toType
	 *                    and false otherwise. (See JDK 1.2.2 API documentation)
	 *
	 * @test_Strategy:    Get the DataBaseMetaData object from the Connection to the DataBase
	 *                    and call the supportsConvert(SMALLINT, VARCHAR) method on that object.
	 *                    It should return a boolean value; either true or false.
	 *
	 */
	public void testSupportsConvert22() throws Fault
	{
		try
		{
			// invoke on the supportsConvert
			boolean retValue = dbmd.supportsConvert(Types.SMALLINT, Types.VARCHAR);
			logMsg("Calling supportsConvert(SMALLINT, VARCHAR) on DatabaseMetaData");
			if(retValue)
			{
				logMsg("supportsConvert(SMALLINT VARCHAR) method is supported");
			}
			else
			{
				logMsg("supportsConvert(SMALLINT VARCHAR) method is not supported");
			}
		}
		catch ( SQLException sqle )
		{
			logErr("SQL exception " + sqle.getMessage() );
			throw new Fault("Call to supportsConvert is Failed!", sqle);
		}
		catch ( Exception e )
		{
			logErr("Unexpected exception " + e.getMessage() );
			throw new Fault("Call to supportsConvert 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");
		}
	}
}
