db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r358591 [5/6] - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ testing/ testing/org/apache/derbyTesting/functionTests/harness/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTes...
Date Thu, 22 Dec 2005 17:29:08 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java Thu Dec 22 09:26:55 2005
@@ -39,10 +39,14 @@
 	This test tests the JDBC PreparedStatement.
 */
 
-class csPrepStmt
+public class csPrepStmt
 {
 	private static Connection conn = null;
 
+    private static String[] testObjects =  // string array for cleaning up
+        {"table t1", "table tab1", "table t2", "table bigtab", "table tstab",
+         "table Numeric_Tab", "table lobCheckOne", "table lobCheckTwo"};
+
 	public static void main (String args[])
 	{
 		try
@@ -52,11 +56,16 @@
 			// Initialize JavaCommonClient Driver.
 			ij.getPropertyArg(args); 
 			conn = ij.startJBMS();
+
 			if (conn == null)
 			{
 				System.out.println("conn didn't work");
 				return;
 			}
+
+			Statement cleanstmt = conn.createStatement();
+			TestUtil.cleanUpTest(cleanstmt, testObjects);
+
 			PreparedStatement ps;
 			ResultSet rs;
 			boolean hasResultSet;
@@ -293,8 +302,23 @@
 				System.out.println("SQLState: " + e.getSQLState() + 
 								   " message: " + e.getMessage());
 			}
-			rs.close();
-			ps.close();
+			finally
+			{
+				try
+				{
+					if(rs != null)
+					{
+						 rs.close();
+						 rs = null;
+					}
+					if(ps != null)
+					{
+						 ps.close();
+						 ps = null;
+					}
+				}
+				catch(Exception e){ }
+			}
 
 			test4975(conn);
 			test5130(conn);
@@ -302,6 +326,11 @@
 			testLobInRS(conn);
 
 			conn.close();
+			// cleanup, first refresh conn
+			conn = ij.startJBMS();
+			cleanstmt = conn.createStatement();
+			TestUtil.cleanUpTest(cleanstmt, testObjects);
+			cleanstmt.close();
 			System.out.println("csPrepStmt Test Ends");
         }
 		catch (Exception e)
@@ -364,6 +393,8 @@
 		ps.setString(2, timestamp );
 		try {
 			ResultSet rs = ps.executeQuery();
+            rs.close();
+			ps.close( );
 		}
 		catch (SQLException e) {
 			System.out.println("SQLState: " + e.getSQLState() + " message: " + e.getMessage());
@@ -503,6 +534,7 @@
 			for (i = 1; i <= numCols; i++)
 				ps.setInt(i,i);
 			ps.executeUpdate();
+			ps.close();
 		} catch (SQLException e)
 		{
 			System.out.println("SQLState: " + e.getSQLState() + 
@@ -588,7 +620,8 @@
 			else
 				System.out.println("FAIL: Statement executed, but returned " +
 					"an empty result set.");
-
+			rs.close();
+			st.close();
 		} catch (Exception e) {
 			System.out.println("FAIL: Encountered exception:");
 			e.printStackTrace();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java Thu Dec 22 09:26:55 2005
@@ -59,18 +59,26 @@
 public class dataSourcePermissions_net extends org.apache.derbyTesting.functionTests.tests.jdbcapi.dataSourcePermissions
 {
 
-	private static final int NETWORKSERVER_PORT = 20000;
-
+	private static int NETWORKSERVER_PORT;
+	private static String hostName;
 	private static NetworkServerControl networkServer = null;
 
 	public static void main(String[] args) throws Exception {
 
+		hostName = TestUtil.getHostName();
+		if (hostName.equals("localhost"))
+			NETWORKSERVER_PORT = 20000;
+		else
+			NETWORKSERVER_PORT = 1527;
+		
 		// Load harness properties.
 		ij.getPropertyArg(args);
 
 		// "runTest()" is going to try to connect to the database through
 		// the server at port NETWORKSERVER_PORT.  Thus, we have to
 		// start the server on that port before calling runTest.
+		// Except when we are using a remote server, then we assume the port is 1527,
+		// and we assume the server has been started already
 
 		try {
 			TestUtil.loadDriver();
@@ -78,13 +86,17 @@
 			e.printStackTrace();
 		}
 
-		// Start the NetworkServer on another thread
-		networkServer = new NetworkServerControl(InetAddress.getByName("localhost"),NETWORKSERVER_PORT);
-		networkServer.start(null);
-
-		// Wait for the NetworkServer to start.
-		if (!isServerStarted(networkServer, 60))
-			System.exit(-1);
+
+		if (hostName.equals("localhost"))
+		{
+			// Start the NetworkServer on another thread
+			networkServer = new NetworkServerControl(InetAddress.getByName("localhost"),NETWORKSERVER_PORT);
+			networkServer.start(null);
+
+			// Wait for the NetworkServer to start.
+			if (!isServerStarted(networkServer, 60))
+				System.exit(-1);
+		}
 
 		// Now, go ahead and run the test.
 		try {
@@ -93,6 +105,7 @@
 			tester.runTest();
 			if (TestUtil.isDerbyNetClientFramework())
 				tester.testClientDataSourceProperties();
+			new dataSourcePermissions_net().cleanUp();
 
 		} catch (Exception e) {
 		// if we catch an exception of some sort, we need to make sure to
@@ -105,10 +118,13 @@
 		}
 
 		// Shutdown the server.
-		networkServer.shutdown();
-		// how do we do this with the new api?
-		//networkServer.join();
-		Thread.sleep(5000);
+		if (hostName.equals("localhost"))
+		{
+			networkServer.shutdown();
+			// how do we do this with the new api?
+			//networkServer.join();
+			Thread.sleep(5000);
+		}
 		System.out.println("Completed dataSourcePermissions_net");
 
 		System.out.close();
@@ -121,10 +137,9 @@
 	}
 
 	public void setProperties() {
-
 		// Set required server properties.
 		System.setProperty("database",
-						   TestUtil.getJdbcUrlPrefix("localhost",
+						   TestUtil.getJdbcUrlPrefix(hostName,
 													 NETWORKSERVER_PORT) +
 						   "wombat;create=true");
 		System.setProperty("ij.user", "EDWARD");
@@ -133,15 +148,19 @@
 	}
 
 	public String getJDBCUrl(String db, String attrs) {
-
-		String s = TestUtil.getJdbcUrlPrefix("localhost", NETWORKSERVER_PORT)
+		// this method is accessed from subclasses - need to establish hostName
+		String hostName = TestUtil.getHostName();
+		if (hostName.equals("localhost"))
+			NETWORKSERVER_PORT = 20000;	
+		else
+			NETWORKSERVER_PORT = 1527;
+		String s = TestUtil.getJdbcUrlPrefix(hostName, NETWORKSERVER_PORT)
 			+ db;
 		if (attrs != null)
 			if (TestUtil.isJCCFramework())
 				s = s + ":" + attrs + ";";
 			else
 				s = s + ";" + attrs;
-		//System.out.println("getJDBCUrl:" + s);
 		return s;
 
 	}
@@ -182,18 +201,27 @@
 
 	private Properties addRequiredAttributes(Properties attrs)
 	{
+		// this method is accessed from subclasses - need to establish hostName
+		hostName = TestUtil.getHostName();
 		if (TestUtil.isJCCFramework())
 		{
 			attrs.setProperty("driverType","4");
             /**
-             * As per the fix of derby-410
-             * servername should now default to localhost 
+             * As per the fix of derby-410 servername should
+             * default to localhost, but for jcc it's still needed  
              */
-            attrs.setProperty("serverName","localhost");
+            attrs.setProperty("serverName",hostName);
 		}
-
-
-		attrs.setProperty("portNumber","20000");
+		/** 
+		 * For a remote host of course it's also needed 
+		 */
+		if (!hostName.equals("localhost"))
+		{
+			attrs.setProperty("serverName",hostName);
+			attrs.setProperty("portNumber", "1527");
+		}
+		else
+			attrs.setProperty("portNumber", "20000");
 		//attrs.setProperty("retrieveMessagesFromServerOnGetMessage","true");
 		return attrs;
 	}
@@ -213,10 +241,9 @@
 	}
 
 	public void shutdown() {
-
 		try {
-			DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost",
-																  NETWORKSERVER_PORT) +
+			DriverManager.getConnection(TestUtil.getJdbcUrlPrefix(hostName,
+															  NETWORKSERVER_PORT) +
 										"wombat;shutdown=true",
 				"EDWARD", "noodle");
 			System.out.println("FAIL - Shutdown returned connection");
@@ -224,8 +251,8 @@
 		} catch (SQLException sqle) {
 			System.out.println("EXPECTED SHUTDOWN " + sqle.getMessage());
 		}
-
 	}
+
 	protected static boolean isServerStarted(NetworkServerControl server, int ntries)
 	{
 		for (int i = 1; i <= ntries; i ++)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java Thu Dec 22 09:26:55 2005
@@ -33,7 +33,7 @@
 	is minimally covered.
 */
 
-class executeUpdate
+public class executeUpdate
 {
 
 	public static void main (String args[])

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java Thu Dec 22 09:26:55 2005
@@ -30,6 +30,7 @@
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derby.tools.ij;
 
 /**
@@ -55,7 +56,7 @@
 			"maxthreads", "a"};
     private static  BufferedOutputStream bos = null;
 	private static  NetworkServerControl server;
-	private static String host = "localhost";
+	private static String host;
 	private static int port = 1527;
 	/**
 	 * Execute the given command and dump the results to standard out
@@ -116,6 +117,9 @@
 
 	public static void main (String args[]) throws Exception
 	{
+		host = TestUtil.getHostName();
+		maxthreadsCmd2[4] = host;
+		
 		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
 			jvm = jvm.getJvm("j9_13");
 		else

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java Thu Dec 22 09:26:55 2005
@@ -40,10 +40,14 @@
 	This test tests the JDBC PreparedStatement.
 */
 
-class prepStmt
+public class prepStmt
 {
 	private static Connection conn = null;
 
+    private static String[] testObjects =  // string array for cleaning up
+        {"table t1", "table tab1", "table t2", "table bigtab", "table tstab",
+         "table doubletab", "table numtab", "table Numeric_Tab", "table jira614"};
+
 	public static void main (String args[])
 	{
 		try
@@ -57,6 +61,10 @@
 				System.out.println("conn didn't work");
 				return;
 			}
+	
+			Statement cleanstmt = conn.createStatement();
+			TestUtil.cleanUpTest(cleanstmt, testObjects);
+
 			PreparedStatement ps;
 			ResultSet rs;
 			boolean hasResultSet;
@@ -301,6 +309,12 @@
 			test5130(conn);
 			test5172(conn);
 			jira614Test(conn);
+			conn.close();
+			// refresh conn before cleaning up
+			conn = ij.startJBMS();
+			cleanstmt = conn.createStatement();
+			TestUtil.cleanUpTest(cleanstmt, testObjects);
+			cleanstmt.close();
 			conn.close();
 			System.out.println("prepStmt Test Ends");
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests Thu Dec 22 09:26:55 2005
@@ -1265,6 +1265,34 @@
 checkSQLCard 0 "     "
 skipDss // ENDUOWRM
 skipDss // SQLCARD for commit
+// use default encoding for drop statement
+createDssRequest
+startDdm EXCSQLIMM
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLSTT
+writeByte 0	// null indicator
+writeEncodedLDString "drop table rdbcmtoktrue" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+endDss "0x40"
+createDssRequest // send commit
+startDdm RDBCMM
+endDdm
+endDss
+flush
+skipDss // RDBUPDRM
+checkSQLCard 0 "     "
+skipDss // ENDUOWRM
+skipDss //SQLCARD for commit
 endTest
 //
 DISPLAY "Test for valid false value for RDBCMTOK in EXCSQLIMM"
@@ -1297,6 +1325,34 @@
 checkSQLCard 0 "     "
 skipDss // ENDUOWRM
 skipDss // SQLCARD for commit
+// use default encoding for drop statement
+createDssRequest
+startDdm EXCSQLIMM
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLSTT
+writeByte 0	// null indicator
+writeEncodedLDString "drop table rdbcmtokfalse" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+endDss "0x40"
+createDssRequest // send commit
+startDdm RDBCMM
+endDdm
+endDss
+flush
+skipDss // RDBUPDRM
+checkSQLCard 0 "     "
+skipDss // ENDUOWRM
+skipDss //SQLCARD for commit
 endTest
 //
 DISPLAY "Test that we only send one RDBUPRM per transaction"
@@ -3100,4 +3156,35 @@
 flush
 checkError SYNTAXRM	8 29 TYPDEFNAM
 endTest
+// 
+include connect.inc
+createDssRequest
+startDdm EXCSQLIMM
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLSTT
+writeByte 0	// null indicator
+writeEncodedLDString "drop schema test restrict" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+endDss "0x40"
+createDssRequest // send commit
+startDdm RDBCMM
+endDdm
+endDss
+flush
+skipDss // RDBUPDRM
+checkSQLCard 0 "     "
+skipDss // ENDUOWRM
+skipDss //SQLCARD for commit
+endTest
+completeTest
 //

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java Thu Dec 22 09:26:55 2005
@@ -32,7 +32,7 @@
 	private static final String DEFAULT_FILENAME = "protocol.tests";
 	
 	// constructor
-	private testProtocol() {}
+	public testProtocol() {}
 	
 
 	/**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testSecMec.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testSecMec.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testSecMec.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testSecMec.java Thu Dec 22 09:26:55 2005
@@ -53,7 +53,7 @@
 
 {
 
-	private static final int NETWORKSERVER_PORT = 20000;
+	private static int NETWORKSERVER_PORT;
 
 	private static NetworkServerControl networkServer = null;
 
@@ -62,6 +62,12 @@
 		// Load harness properties.
 		ij.getPropertyArg(args);
 
+		String hostName = TestUtil.getHostName();
+		if (hostName.equals("localhost"))
+			NETWORKSERVER_PORT = 20000;
+		else
+			NETWORKSERVER_PORT = 1527;
+
 		// "runTest()" is going to try to connect to the database through
 		// the server at port NETWORKSERVER_PORT.  Thus, we have to
 		// start the server on that port before calling runTest.
@@ -72,13 +78,16 @@
 			e.printStackTrace();
 		}
 
-		// Start the NetworkServer on another thread
-		networkServer = new NetworkServerControl(InetAddress.getByName("localhost"),NETWORKSERVER_PORT);
-		networkServer.start(null);
-
-		// Wait for the NetworkServer to start.
-		if (!isServerStarted(networkServer, 60))
-			System.exit(-1);
+		// Start the NetworkServer on another thread, unless it's a remote host
+		networkServer = new NetworkServerControl(InetAddress.getByName(hostName),NETWORKSERVER_PORT);
+		if (hostName.equals("localhost"))
+		{
+			networkServer.start(null);
+
+			// Wait for the NetworkServer to start.
+			if (!isServerStarted(networkServer, 60))
+				System.exit(-1);
+		}
 
 		// Now, go ahead and run the test.
 		try {
@@ -96,10 +105,13 @@
 		}
 
 		// Shutdown the server.
-		networkServer.shutdown();
-		// how do we do this with the new api?
-		//networkServer.join();
-		Thread.sleep(5000);
+		if (hostName.equals("localhost"))
+		{
+			networkServer.shutdown();
+			// how do we do this with the new api?
+			//networkServer.join();
+			Thread.sleep(5000);
+		}
 		System.out.println("Completed testSecMec");
 
 		System.out.close();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java Thu Dec 22 09:26:55 2005
@@ -28,6 +28,7 @@
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derby.tools.ij;
 
 /**
@@ -39,6 +40,7 @@
 
 	private static jvm jvm;
 	private static Vector vCmd;
+	private static String hostName;
 	private static String[] TestConnectionCmd1 = new String[] {"org.apache.derby.drda.NetworkServerControl",
 		"ping"};
 	private static String[] TestConnectionCmd2 = new String[] {"org.apache.derby.drda.NetworkServerControl",
@@ -51,9 +53,13 @@
 	private static String[] TestConnectionCmd5 = new String[] {"org.apache.derby.drda.NetworkServerControl",
 		"ping", "-h", "localhost", "-p", "9393"};
 	private static String[] TestConnectionCmd6 = new String[] {"org.apache.derby.drda.NetworkServerControl",
-		"ping", "-p", "1527"};
+		"ping", "-h", "localhost", "-p", "1527"};
+	private static String[] TestConnectionCmd6b = new String[] {"org.apache.derby.drda.NetworkServerControl",
+		"ping", "-h", "localhost", "-p", "1527"};
 	private static String[] TestConnectionCmd7 = new String[] {"org.apache.derby.drda.NetworkServerControl",
-		"ping", "-p", "9393"};
+		"ping", "-h", "localhost", "-p", "9393"};
+	private static String[] TestConnectionCmd7b = new String[] {"org.apache.derby.drda.NetworkServerControl",
+		"ping", "-h", "localhost", "-p", "9393"};
 
     private static  BufferedOutputStream bos = null;
     
@@ -61,23 +67,49 @@
 	 * Execute the given command and dump the results to standard out
 	 *
 	 * @param args	command and arguments
+     * @param printcmd to printout the executing command or not
+	 * @exception Exception
+	 */
+    private static void execCmdDumpResults (String[] args, boolean printcmd)
+        throws Exception
+    {
+        execCmdDumpResults(args, 0, printcmd);
+    }
+
+    /**
+	 * Execute the given command and dump the results to standard out
+	 *
+	 * @param args	command and arguments
 	 * @exception Exception
 	 */
     private static void execCmdDumpResults (String[] args)
         throws Exception
     {
-        execCmdDumpResults(args, 0);
+        execCmdDumpResults(args, 0, true);
     }
 
+
 	/**
 	 * Execute the given command and dump the results to standard out
 	 *
 	 * @param args	command and arguments
      * @param expectedExitCode the exit code that we expect from running this
+     */
+	private static void execCmdDumpResults (String[] args, int expectedExitCode)
+        throws Exception
+	{
+        execCmdDumpResults(args, expectedExitCode, true);
+    }
+
+	/**
+	 * Execute the given command and dump the results to standard out
+	 *
+	 * @param args	command and arguments
+     * @param expectedExitCode the exit code that we expect from running this
+     * @param printcmd to indicate if the executing command should get printed
 	 * @exception Exception
 	 */
-
-	private static void execCmdDumpResults (String[] args, int expectedExitCode)
+	private static void execCmdDumpResults (String[] args, int expectedExitCode, boolean printcmd)
         throws Exception
 	{
         // We need the process inputstream and errorstream
@@ -90,7 +122,10 @@
         {
             sb.append(args[i] + " ");                    
         }
-        System.out.println(sb.toString());
+        if (printcmd)
+            System.out.println(sb.toString());
+        else
+            System.out.println("org.apache.derby.drda.NetworkServerControl ping...");            
 		int totalSize = vCmd.size() + args.length;
 		String serverCmd[] = new String[totalSize];
 		int i;
@@ -130,6 +165,15 @@
 
 	public static void main (String args[]) throws Exception
 	{
+		hostName = TestUtil.getHostName();
+		TestConnectionCmd2[3] = hostName;
+		TestConnectionCmd4[3] = hostName;
+		TestConnectionCmd5[3] = hostName;
+		TestConnectionCmd6b[3] = hostName;
+		TestConnectionCmd7b[3] = hostName;
+        
+ 
+		
 		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
 			jvm = jvm.getJvm("j9_13");
 		else
@@ -145,7 +189,12 @@
 			 ************************************************************/
 			System.out.println("Testing testconnection");
 			//test connection - no parameters
-			execCmdDumpResults(TestConnectionCmd1);	
+            if (!hostName.equals("localhost")) // except with remote server, add the hostName 
+            {
+                execCmdDumpResults(TestConnectionCmd4, 0, false);
+            }
+            else
+		    	execCmdDumpResults(TestConnectionCmd1, false);	
 			//test connection - specifying host and port
 			execCmdDumpResults(TestConnectionCmd2);	
 			//test connection - specifying non-existant host and port
@@ -157,9 +206,15 @@
 			//test connection - specifying host and invalid port
 			execCmdDumpResults(TestConnectionCmd5, 1);	
 			//test connection - specifying no host and valid port
-			execCmdDumpResults(TestConnectionCmd6);	
+            if (!hostName.equals("localhost")) // except with remote server, add the hostName
+			    execCmdDumpResults(TestConnectionCmd6b, false);	
+            else
+			    execCmdDumpResults(TestConnectionCmd6, false);	
 			//test connection - specifying no host and invalid port
-			execCmdDumpResults(TestConnectionCmd7, 1);	
+            if (!hostName.equals("localhost")) // except with remote server, add the hostName
+			    execCmdDumpResults(TestConnectionCmd7b, 1, false);	
+            else
+			    execCmdDumpResults(TestConnectionCmd7, 1, false);	
 
 			System.out.println("End test");
 			bos.close();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java Thu Dec 22 09:26:55 2005
@@ -23,11 +23,17 @@
 import java.util.Vector;
 import java.util.Properties;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.BufferedOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.FileNotFoundException;
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derbyTesting.functionTests.harness.Sed;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 import org.apache.derby.drda.NetworkServerControl;
@@ -40,11 +46,15 @@
 	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
-	private static String[] jccIjCmd = new String[] {"org.apache.derby.tools.ij",
-		"extin/testij.sql"};
 
-	private static String[] clientIjCmd = new String[] {"org.apache.derby.tools.ij",
-													 "extin/testclientij.sql"};
+	private static String IjCmd="org.apache.derby.tools.ij";
+	private static String SqlDir="extin";
+	private static String jccSqlFile="testij.sql";
+	private static String sep;
+	private static String clientSqlFile="testclientij.sql";
+	private static String altExtinDir;
+	private static boolean useAltExtinDir=false;
+	
 	private static void execCmd (String[] args) throws Exception
 	{
 		int totalSize = vCmd.size() + args.length;
@@ -115,6 +125,42 @@
 		bos.close();
 
 	}
+	
+    public static void massageSqlFile (String hostName, String fileName) throws Exception {
+        // only called if hostName is *not* localhost. 
+        // Need to replace each occurrence of the string 'localhost' with 
+        // whatever is the hostName
+        File tmpFile = new File("extin", "tmpFile.sql");
+        File orgFile = new File("extin", fileName);
+        // wrap this in a try to possibly try using user.dir to find the file
+        InputStream original; 
+        OutputStream copy; 
+        try { 
+            fileName = SqlDir + sep + fileName; 
+            original = new FileInputStream(fileName);
+            copy = new FileOutputStream(tmpFile);
+        }
+        catch (FileNotFoundException fnfe) {
+            // we must be running from within a suite...
+            useAltExtinDir = true;
+            String userdir =  System.getProperty("user.dir");
+            altExtinDir = userdir + sep + ".."; 
+            tmpFile = new File(altExtinDir, "tmpFile.sql");
+            orgFile = new File (altExtinDir,  fileName); 
+            fileName = altExtinDir + sep + fileName;
+            original = new FileInputStream(fileName);
+            copy = new FileOutputStream(tmpFile);
+        }
+        int content;
+        while ((content = original.read())> 0 ) {
+            copy.write(content);
+        }
+        copy.close();
+        original.close();
+        Sed hostSed = new Sed();
+        InputStream sedIs = new ByteArrayInputStream(("substitute=localhost;" + hostName).getBytes("UTF-8"));
+        hostSed.exec(tmpFile, orgFile, sedIs, false, false);		
+    }
 
 	public static void main (String args[]) throws Exception
 	{
@@ -123,6 +169,7 @@
 		else
 			jvm = jvm.getJvm("currentjvm");		// ensure compatibility
 		vCmd = jvm.getCommandLine();
+		sep =  System.getProperty("file.separator");
 		try
 		{
 			/************************************************************
@@ -131,10 +178,27 @@
 			//create wombat database
 			NetworkServerControl server = new NetworkServerControl();
 			System.out.println("Testing various ij connections and comments in front of selects");
-			if (TestUtil.isJCCFramework())
-				execCmdDumpResults(jccIjCmd);	
-			else   // Derby Client
-				execCmdDumpResults(clientIjCmd);	
+			
+			// first, we have to massage the .sql file to replace localhost, if 
+			// there is a system property set.
+						
+			String hostName=TestUtil.getHostName();
+			if (TestUtil.isJCCFramework()){
+				// use jccSqlfile
+				if (!hostName.equals("localhost")) 
+					massageSqlFile(hostName,jccSqlFile);
+				if (useAltExtinDir)	
+					execCmdDumpResults(new String[]{IjCmd,(altExtinDir + sep + SqlDir + sep + jccSqlFile)});
+				execCmdDumpResults(new String[]{IjCmd,(SqlDir + sep + jccSqlFile)});
+			} else {   // Derby Client
+				// use clientSqlFile
+				if(!hostName.equals("localhost")) {
+					massageSqlFile(hostName,clientSqlFile);
+				if (useAltExtinDir)	
+					execCmdDumpResults(new String[]{IjCmd,(altExtinDir + sep + SqlDir + sep + clientSqlFile)});
+				}
+				execCmdDumpResults(new String[]{IjCmd,(SqlDir + sep + clientSqlFile)});
+			}
 			System.out.println("End test");
 		}
 		catch (Exception e)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_sed.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_sed.properties?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_sed.properties (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_sed.properties Thu Dec 22 09:26:55 2005
@@ -9,7 +9,7 @@
 # No commas or semicolons can be allowed in the patterns/subsitutes.
 -------------------------------------------------------------------------------
 --
-substitute=(server log.*);(server log XXX),Required user property not set;null userid not supported
+substitute=(server log.*);(server log XXX),Required user property not set;null userid not supported,org.apache.derby.tools.ij.*;org.apache.derby.tools.ij xxxFILTERED_TESTIJSOURCExxx
 
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java Thu Dec 22 09:26:55 2005
@@ -30,6 +30,7 @@
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derby.tools.ij;
 
 /**
@@ -55,7 +56,7 @@
 			"timeslice", "a"};
     private static  BufferedOutputStream bos = null;
 	private static  NetworkServerControl server;
-	private static String host = "localhost";
+	private static String host;
 	private static int port = 1527;
 	/**
 	 * Execute the given command and dump the results to standard out
@@ -115,6 +116,8 @@
 
 	public static void main (String args[]) throws Exception
 	{
+		host = TestUtil.getHostName();
+		timesliceCmd2[4] = host;
 		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
 			jvm = jvm.getJvm("j9_13");
 		else

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java Thu Dec 22 09:26:55 2005
@@ -470,6 +470,7 @@
 				" ) values (cast (X'a78a' as blob(80)) )";
 			Xprint(insert);
 		}
+            Xprint("drop table blobCheck");
 	}
     public void test() throws SQLException {
         // create table for testing

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java Thu Dec 22 09:26:55 2005
@@ -65,10 +65,12 @@
 			// make the initial connection.
 			ij.getPropertyArg(args);
 			Connection conn = ij.startJBMS();
+			cleanUp(conn);
 			test1(conn);
 			test2(conn);
 			test3(conn);
 
+			cleanUp(conn);
 			conn.close();		
 				
 		} catch (SQLException e) {
@@ -81,6 +83,16 @@
 		System.out.println("Statement Close Fun Test finished");
 	}
 
+	
+    private static void cleanUp(Connection conn) throws SQLException {
+	Statement s = conn.createStatement();
+	String[] testObjects = {"PROCEDURE TAKESSTRING", "TABLE TAB1", "TABLE TAB2", "TABLE TAB3"};
+        try {
+		TestUtil.cleanUpTest(s, testObjects);
+	} catch (SQLException se){//
+	}
+    }
+
     private static void test1(Connection conn) {
 		Statement s;
         try {
@@ -583,7 +595,6 @@
 				}
 				catch(SQLException e) { }
 
-				s.execute("drop procedure takesString");
 				s.close();
 			}
 		

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java Thu Dec 22 09:26:55 2005
@@ -1,465 +1,467 @@
-/*
-
-Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream
-
-Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-*/
-
-package org.apache.derbyTesting.functionTests.tests.jdbcapi;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-
-import java.io.IOException;
-import java.sql.SQLException;
-
-import org.apache.derby.tools.ij;
-
-
-public class Stream {
-    
-    public static void main(String[] args){
-	
-	Connection conn = null;
-
-	try{
-	    ij.getPropertyArg(args);
-	    conn = ij.startJBMS();
-	    
-	    createTestTables(conn);
-	    executeTests(conn);
-	    dropTestTables(conn);
-	    
-	}catch(Throwable t){
-	    t.printStackTrace();
-	    
-	}finally{
-	    if(conn != null){
-		try{
-		    conn.close();
-		    
-		}catch(SQLException e){
-		    e.printStackTrace();
-		}
-		
-	    }
-	}
-	
-    }
-
-    
-    private static void createTestTables(Connection conn) 
-	throws SQLException,IOException {
-	
-	createTable(conn);
-	createTestData(conn);
-	
-    }
-    
-    
-    private static void createTable(Connection conn) throws SQLException {
-	
-	Statement st = null;
-	
-	try{
-	    
-	    st = conn.createStatement();
-	    st.execute("create table SMALL_BLOB_TABLE( SMALL_BLOB blob( 512 ))");
-	    st.execute("create table LARGE_BLOB_TABLE( LARGE_BLOB blob( 512k ))");
-	    st.execute("create table SMALL_CLOB_TABLE( SMALL_CLOB clob( 512 ))");
-	    st.execute("create table LARGE_CLOB_TABLE( LARGE_CLOB clob( 512k ))");
-
-	}finally{
-	    if(st != null)
-		st.close();
-	}
-	
-    }
-
-    
-    private static void createTestData(Connection conn) 
-	throws SQLException,IOException {
-
-	createSmallBlobTestData( conn );
-	createLargeBlobTestData( conn );
-	createSmallClobTestData( conn );
-	createLargeClobTestData( conn );
-	
-    }
-    
-    
-    private static void createSmallBlobTestData(Connection conn) 
-	throws SQLException,IOException {
-	
-	PreparedStatement st = null;
-	TestDataStream stream = null;
-
-	try{
-	    st = conn.prepareStatement("insert into SMALL_BLOB_TABLE(SMALL_BLOB) values(?)");
-	    stream = new TestDataStream(512);
-	    st.setBinaryStream(1, stream, 512);
-	    st.executeUpdate();
-	    
-	}finally{
-	    if(st != null){
-		st.close();
-	    }
-
-	    if(stream != null){
-		stream.close();
-	    }
-	    
-	}
-
-    }
-    
-    
-    private static void createLargeBlobTestData(Connection conn) 
-	throws SQLException,IOException {
-	
-	PreparedStatement st = null;
-	TestDataStream stream = null;
-	
-	try{
-	    st = conn.prepareStatement("insert into LARGE_BLOB_TABLE(LARGE_BLOB) values(?)");
-	    stream = new TestDataStream( 512 * 1024);
-	    st.setBinaryStream(1,stream, 512 * 1024);
-
-	    st.executeUpdate();
-	    
-	}finally{
-	    if(st != null){
-		st.close();
-	    }
-
-	    if(stream != null){
-		stream.close();
-	    }
-	}
-    }
-    
-    
-    private static void createSmallClobTestData(Connection conn)
-	throws SQLException,IOException {
-	
-	PreparedStatement st = null;
-	TestDataReader reader = null;
-	
-	try{
-	    st = conn.prepareStatement("insert into SMALL_CLOB_TABLE( SMALL_CLOB ) values(?)");
-
-	    reader = new TestDataReader( 512 );
-	    st.setCharacterStream(1,
-				  reader, 
-				  512);
-	    
-	    st.executeUpdate();
-	    
-	    
-	}finally{
-	    if(st != null)
-		st.close();
-	    
-	    if(reader != null)
-		reader.close();
-	    
-	}
-	
-    }   
-    
-
-    private static void createLargeClobTestData(Connection conn)
-	throws SQLException, IOException {
-	
-	PreparedStatement st = null;
-	TestDataReader reader = null;
-
-	try{
-	    st = conn.prepareStatement("insert into LARGE_CLOB_TABLE( LARGE_CLOB ) values(?)");
-	    
-	    reader = new TestDataReader( 512 * 1024 );
-	    st.setCharacterStream(1,
-				  reader,
-				  512 * 1024 );
-	    
-	    st.executeUpdate();
-	    
-	    
-	} finally {
-	    if(st != null)
-		st.close();
-	    
-	    if(reader != null)
-		reader.close();
-	}
-    }
-
-    private static void executeTests(Connection conn) 
-	throws SQLException, IOException {
-	
-	executeTestOnSmallBlob( conn );
-	executeTestOnLargeBlob( conn );
-	executeTestOnSmallClob( conn );
-	executeTestOnLargeClob( conn );
-	
-    }
-    
-    
-    private static void executeTestOnSmallBlob( Connection conn ) 
-	throws SQLException, IOException {
-	
-	BlobTester tester = new BlobTester( "SMALL_BLOB_TABLE", 
-					    "SMALL_BLOB" );
-	tester.testGetStreamTwice( conn );
-	
-    }
-
-
-    private static void executeTestOnLargeBlob( Connection conn ) 
-	throws SQLException, IOException {
-	
-	BlobTester tester = new BlobTester( "LARGE_BLOB_TABLE", 
-					    "LARGE_BLOB" );
-	tester.testGetStreamTwice( conn );
-	
-    }
-    
-    
-    private static void executeTestOnSmallClob( Connection conn ) 
-	throws SQLException, IOException {
-	
-	ClobTester tester = new ClobTester( "SMALL_CLOB_TABLE",
-					    "SMALL_CLOB" );
-	tester.testGetReaderTwice( conn );
-
-    }
-
-
-    private static void executeTestOnLargeClob( Connection conn ) 
-	throws SQLException, IOException {
-	
-	ClobTester tester = new ClobTester( "LARGE_CLOB_TABLE",
-					    "LARGE_CLOB" );
-	tester.testGetReaderTwice( conn );
-
-    }
-    
-
-    private static void dropTestTables( Connection conn ) throws SQLException {
-	
-	Statement st = null;
-	
-	try{
-	    st = conn.createStatement();
-	    st.execute("drop table SMALL_BLOB_TABLE");
-	    st.execute("drop table LARGE_BLOB_TABLE");
-
-	}finally{
-	    if(st != null)
-		st.close();
-	}
-	
-    }
-    
-    
-    static class TestDataStream extends InputStream {
-	
-	private long streamedLength = 0;
-	private final long total;
-	
-	
-	public TestDataStream(long length){
-	    total = length;
-	}
-	
-	
-	public int read(){
-	    
-	    if(streamedLength >= total){
-		return -1;
-	    }
-
-	    return (int) ((streamedLength ++) % 256L);
-	    
-	}
-	
-	
-	public void close(){
-	    streamedLength = total;
-	}
-	
-    }
-    
-
-    static class TestDataReader extends Reader {
-	
-	private long wroteLength = 0;
-	private final long total;
-
-	
-	public TestDataReader(long length){
-	    total = length;
-	}
-
-	
-	public void close(){
-	    wroteLength = total;
-	}
-
-	
-	public int read( char[] cbuf,
-			 int off,
-			 int len ){
-	    
-	    if(wroteLength >= total)
-		return -1;
-	    
-	    int i;
-	    for(i = off ;
-		i < off + len &&
-		    wroteLength <= total ;
-		i++, wroteLength ++){
-		
-		cbuf[i] = (char) (wroteLength % 0x10000L);
-		
-	    }
-
-	    return i - off;
-	}
-	
-    }
-    
-    
-    static class BlobTester {
-	
-	final String tableName;
-	final String colName;
-	
-	
-	BlobTester(String tableName,
-		   String colName){
-	    
-	    this.tableName  = tableName;
-	    this.colName = colName;
-	    
-	}
-	
-	
-	public void testGetStreamTwice(Connection conn) 
-	    throws SQLException, IOException {
-	    
-	    Statement st = null;
-	    ResultSet rs = null;
-	    InputStream is = null;
-
-	    try{
-		st = conn.createStatement();
-		
-		rs = st.executeQuery("select " + 
-				     colName + " "+ 
-				     "from " + 
-				     tableName);
-		rs.next();
-		
-		System.out.println("get stream from " + tableName + "." + colName + " ...");
-		is = rs.getBinaryStream(1);
-		is.close();
-		
-		System.out.println("get stream from " + tableName + "." + colName + " again ...");
-		is = rs.getBinaryStream(1);
-		
-		System.out.println("Expected exception did not happen.");
-		
-	    }catch(SQLException e){
-		System.out.println("Expected exception may happen.");
-		e.printStackTrace(System.out);
-		
-	    }finally{
-		if( st != null )
-		    st.close();
-		
-		if( rs != null )
-		    rs.close();
-		
-		if( is != null )
-		    is.close();
-		
-	    }
-	}
-    }
-
-
-    static class ClobTester {
-	
-	final String tableName;
-	final String colName;
-
-	public ClobTester( String tableName ,
-			   String colName ){
-	    
-	    this.tableName = tableName;
-	    this.colName = colName;
-	    
-	}
-	
-	
-	public void testGetReaderTwice( Connection conn ) 
-	    throws SQLException, IOException {
-	    
-	    Statement st = null;
-	    ResultSet rs = null;
-	    Reader reader = null;
-
-	    try{
-		st = conn.createStatement();
-		
-		rs = st.executeQuery( "select " + 
-				      colName + " " + 
-				      "from " + 
-				      tableName );
-		rs.next();
-		
-		System.out.println("get reader from " + tableName + "." + colName + " ...");
-		reader = rs.getCharacterStream(1);
-		reader.close();
-		
-		System.out.println("get reader from " + tableName + "." + colName + "again ...");
-		reader = rs.getCharacterStream(1);
-		
-		System.out.println("Expected exception did not happen.");
-		
-	    }catch(SQLException e){
-		System.out.println("Expected exception may happen.");
-		e.printStackTrace(System.out);
-
-	    }finally{
-		if(st != null)
-		    st.close();
-		
-		if(rs != null)
-		    rs.close();
-
-		if(reader != null)
-		    reader.close();
-
-	    }
-	}
-    }
-}
+/*
+
+Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream
+
+Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+*/
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import java.io.IOException;
+import java.sql.SQLException;
+
+import org.apache.derby.tools.ij;
+
+
+public class Stream {
+    
+    public static void main(String[] args){
+	
+	Connection conn = null;
+
+	try{
+	    ij.getPropertyArg(args);
+	    conn = ij.startJBMS();
+	    
+	    createTestTables(conn);
+	    executeTests(conn);
+	    dropTestTables(conn);
+	    
+	}catch(Throwable t){
+	    t.printStackTrace();
+	    
+	}finally{
+	    if(conn != null){
+		try{
+		    conn.close();
+		    
+		}catch(SQLException e){
+		    e.printStackTrace();
+		}
+		
+	    }
+	}
+	
+    }
+
+    
+    private static void createTestTables(Connection conn) 
+	throws SQLException,IOException {
+	
+	createTable(conn);
+	createTestData(conn);
+	
+    }
+    
+    
+    private static void createTable(Connection conn) throws SQLException {
+	
+	Statement st = null;
+	
+	try{
+	    
+	    st = conn.createStatement();
+	    st.execute("create table SMALL_BLOB_TABLE( SMALL_BLOB blob( 512 ))");
+	    st.execute("create table LARGE_BLOB_TABLE( LARGE_BLOB blob( 512k ))");
+	    st.execute("create table SMALL_CLOB_TABLE( SMALL_CLOB clob( 512 ))");
+	    st.execute("create table LARGE_CLOB_TABLE( LARGE_CLOB clob( 512k ))");
+
+	}finally{
+	    if(st != null)
+		st.close();
+	}
+	
+    }
+
+    
+    private static void createTestData(Connection conn) 
+	throws SQLException,IOException {
+
+	createSmallBlobTestData( conn );
+	createLargeBlobTestData( conn );
+	createSmallClobTestData( conn );
+	createLargeClobTestData( conn );
+	
+    }
+    
+    
+    private static void createSmallBlobTestData(Connection conn) 
+	throws SQLException,IOException {
+	
+	PreparedStatement st = null;
+	TestDataStream stream = null;
+
+	try{
+	    st = conn.prepareStatement("insert into SMALL_BLOB_TABLE(SMALL_BLOB) values(?)");
+	    stream = new TestDataStream(512);
+	    st.setBinaryStream(1, stream, 512);
+	    st.executeUpdate();
+	    
+	}finally{
+	    if(st != null){
+		st.close();
+	    }
+
+	    if(stream != null){
+		stream.close();
+	    }
+	    
+	}
+
+    }
+    
+    
+    private static void createLargeBlobTestData(Connection conn) 
+	throws SQLException,IOException {
+	
+	PreparedStatement st = null;
+	TestDataStream stream = null;
+	
+	try{
+	    st = conn.prepareStatement("insert into LARGE_BLOB_TABLE(LARGE_BLOB) values(?)");
+	    stream = new TestDataStream( 512 * 1024);
+	    st.setBinaryStream(1,stream, 512 * 1024);
+
+	    st.executeUpdate();
+	    
+	}finally{
+	    if(st != null){
+		st.close();
+	    }
+
+	    if(stream != null){
+		stream.close();
+	    }
+	}
+    }
+    
+    
+    private static void createSmallClobTestData(Connection conn)
+	throws SQLException,IOException {
+	
+	PreparedStatement st = null;
+	TestDataReader reader = null;
+	
+	try{
+	    st = conn.prepareStatement("insert into SMALL_CLOB_TABLE( SMALL_CLOB ) values(?)");
+
+	    reader = new TestDataReader( 512 );
+	    st.setCharacterStream(1,
+				  reader, 
+				  512);
+	    
+	    st.executeUpdate();
+	    
+	    
+	}finally{
+	    if(st != null)
+		st.close();
+	    
+	    if(reader != null)
+		reader.close();
+	    
+	}
+	
+    }   
+    
+
+    private static void createLargeClobTestData(Connection conn)
+	throws SQLException, IOException {
+	
+	PreparedStatement st = null;
+	TestDataReader reader = null;
+
+	try{
+	    st = conn.prepareStatement("insert into LARGE_CLOB_TABLE( LARGE_CLOB ) values(?)");
+	    
+	    reader = new TestDataReader( 512 * 1024 );
+	    st.setCharacterStream(1,
+				  reader,
+				  512 * 1024 );
+	    
+	    st.executeUpdate();
+	    
+	    
+	} finally {
+	    if(st != null)
+		st.close();
+	    
+	    if(reader != null)
+		reader.close();
+	}
+    }
+
+    private static void executeTests(Connection conn) 
+	throws SQLException, IOException {
+	
+	executeTestOnSmallBlob( conn );
+	executeTestOnLargeBlob( conn );
+	executeTestOnSmallClob( conn );
+	executeTestOnLargeClob( conn );
+	
+    }
+    
+    
+    private static void executeTestOnSmallBlob( Connection conn ) 
+	throws SQLException, IOException {
+	
+	BlobTester tester = new BlobTester( "SMALL_BLOB_TABLE", 
+					    "SMALL_BLOB" );
+	tester.testGetStreamTwice( conn );
+	
+    }
+
+
+    private static void executeTestOnLargeBlob( Connection conn ) 
+	throws SQLException, IOException {
+	
+	BlobTester tester = new BlobTester( "LARGE_BLOB_TABLE", 
+					    "LARGE_BLOB" );
+	tester.testGetStreamTwice( conn );
+	
+    }
+    
+    
+    private static void executeTestOnSmallClob( Connection conn ) 
+	throws SQLException, IOException {
+	
+	ClobTester tester = new ClobTester( "SMALL_CLOB_TABLE",
+					    "SMALL_CLOB" );
+	tester.testGetReaderTwice( conn );
+
+    }
+
+
+    private static void executeTestOnLargeClob( Connection conn ) 
+	throws SQLException, IOException {
+	
+	ClobTester tester = new ClobTester( "LARGE_CLOB_TABLE",
+					    "LARGE_CLOB" );
+	tester.testGetReaderTwice( conn );
+
+    }
+    
+
+    private static void dropTestTables( Connection conn ) throws SQLException {
+	
+	Statement st = null;
+	
+	try{
+	    st = conn.createStatement();
+	    st.execute("drop table SMALL_BLOB_TABLE");
+	    st.execute("drop table LARGE_BLOB_TABLE");
+	    st.execute("drop table SMALL_CLOB_TABLE");
+	    st.execute("drop table LARGE_CLOB_TABLE");
+
+	}finally{
+	    if(st != null)
+		st.close();
+	}
+	
+    }
+    
+    
+    static class TestDataStream extends InputStream {
+	
+	private long streamedLength = 0;
+	private final long total;
+	
+	
+	public TestDataStream(long length){
+	    total = length;
+	}
+	
+	
+	public int read(){
+	    
+	    if(streamedLength >= total){
+		return -1;
+	    }
+
+	    return (int) ((streamedLength ++) % 256L);
+	    
+	}
+	
+	
+	public void close(){
+	    streamedLength = total;
+	}
+	
+    }
+    
+
+    static class TestDataReader extends Reader {
+	
+	private long wroteLength = 0;
+	private final long total;
+
+	
+	public TestDataReader(long length){
+	    total = length;
+	}
+
+	
+	public void close(){
+	    wroteLength = total;
+	}
+
+	
+	public int read( char[] cbuf,
+			 int off,
+			 int len ){
+	    
+	    if(wroteLength >= total)
+		return -1;
+	    
+	    int i;
+	    for(i = off ;
+		i < off + len &&
+		    wroteLength <= total ;
+		i++, wroteLength ++){
+		
+		cbuf[i] = (char) (wroteLength % 0x10000L);
+		
+	    }
+
+	    return i - off;
+	}
+	
+    }
+    
+    
+    static class BlobTester {
+	
+	final String tableName;
+	final String colName;
+	
+	
+	BlobTester(String tableName,
+		   String colName){
+	    
+	    this.tableName  = tableName;
+	    this.colName = colName;
+	    
+	}
+	
+	
+	public void testGetStreamTwice(Connection conn) 
+	    throws SQLException, IOException {
+	    
+	    Statement st = null;
+	    ResultSet rs = null;
+	    InputStream is = null;
+
+	    try{
+		st = conn.createStatement();
+		
+		rs = st.executeQuery("select " + 
+				     colName + " "+ 
+				     "from " + 
+				     tableName);
+		rs.next();
+		
+		System.out.println("get stream from " + tableName + "." + colName + " ...");
+		is = rs.getBinaryStream(1);
+		is.close();
+		
+		System.out.println("get stream from " + tableName + "." + colName + " again ...");
+		is = rs.getBinaryStream(1);
+		
+		System.out.println("Expected exception did not happen.");
+		
+	    }catch(SQLException e){
+		System.out.println("Expected exception may happen.");
+		e.printStackTrace(System.out);
+		
+	    }finally{
+		if( st != null )
+		    st.close();
+		
+		if( rs != null )
+		    rs.close();
+		
+		if( is != null )
+		    is.close();
+		
+	    }
+	}
+    }
+
+
+    static class ClobTester {
+	
+	final String tableName;
+	final String colName;
+
+	public ClobTester( String tableName ,
+			   String colName ){
+	    
+	    this.tableName = tableName;
+	    this.colName = colName;
+	    
+	}
+	
+	
+	public void testGetReaderTwice( Connection conn ) 
+	    throws SQLException, IOException {
+	    
+	    Statement st = null;
+	    ResultSet rs = null;
+	    Reader reader = null;
+
+	    try{
+		st = conn.createStatement();
+		
+		rs = st.executeQuery( "select " + 
+				      colName + " " + 
+				      "from " + 
+				      tableName );
+		rs.next();
+		
+		System.out.println("get reader from " + tableName + "." + colName + " ...");
+		reader = rs.getCharacterStream(1);
+		reader.close();
+		
+		System.out.println("get reader from " + tableName + "." + colName + "again ...");
+		reader = rs.getCharacterStream(1);
+		
+		System.out.println("Expected exception did not happen.");
+		
+	    }catch(SQLException e){
+		System.out.println("Expected exception may happen.");
+		e.printStackTrace(System.out);
+
+	    }finally{
+		if(st != null)
+		    st.close();
+		
+		if(rs != null)
+		    rs.close();
+
+		if(reader != null)
+		    reader.close();
+
+	    }
+	}
+    }
+}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java Thu Dec 22 09:26:55 2005
@@ -32,6 +32,8 @@
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
 
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
 /**
  * Test the new Auto Generated Keys feature in jdbc 30 for Statement and PreparedStatement.
  *
@@ -39,6 +41,9 @@
  */
 
 public class autoGeneratedJdbc30 { 
+
+	private static String[] testObjects= {"table t11","table t21","table t31"};
+
 	public static void main(String[] args) {
 
 		Connection con = null;
@@ -63,6 +68,9 @@
 
 			negativeTests(con);
 
+			s = con.createStatement();
+			TestUtil.cleanUpTest(s, testObjects);
+			con.commit();
 			con.close();
 		}
 		catch (SQLException e) {
@@ -112,6 +120,15 @@
 	//Set up the test by creating the table used by the rest of the test.
 	public static void setUpTest(Statement s)
 					throws SQLException {
+		try {
+			// first drop to make sure there's nothing there
+			s.execute("drop table t11");
+			s.execute("drop table t21");
+			s.execute("drop table t31");
+		} catch (SQLException se) {
+			// assume failure because there really wasn't anything there 
+		}
+
 		/* Create a table */
 		// set by increment not yet supported for create table...
 		// does not matter for purpose of this test.
@@ -883,6 +900,7 @@
 				else
 					JDBCDisplayUtil.ShowSQLException(System.out,e);
 			}
+		con.rollback();
 	}
 
 	public static void doTest1920(Statement s, Connection con) throws SQLException

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql Thu Dec 22 09:26:55 2005
@@ -125,3 +125,5 @@
 
 rollback work;
 
+drop procedure getBestRowID;
+commit;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java Thu Dec 22 09:26:55 2005
@@ -57,6 +57,10 @@
 public class blobclob4BLOB { 
 
 	static String[] fileName;
+	static String[] basefileName; // for printing messages so that no path info is in .out
+	static String filePath;
+	static String unicodeFilePath;
+	static String sep;
 	static long[] fileLength;
     static int numFiles;
     static int numRows;
@@ -72,14 +76,21 @@
 	static
 	{
 		numFiles = 5;
+		filePath = "extin";
 		fileName = new String[numFiles];
+		basefileName = new String[numFiles];
 		fileLength = new long[numFiles];
 
-		fileName[0] = "extin/short.txt";	// set up a short (fit in one page) blob/clob
-		fileName[1] = "extin/littleclob.txt"; // set up a long (longer than a page) blob/clob
-		fileName[2] = "extin/empty.txt"; // set up a blob/clob with nothing in it
-		fileName[3] = "extin/searchclob.txt"; // set up a blob/clob to search with
-		fileName[4] = "extin/aclob.txt"; // set up a really long (over 300K) blob/clob
+		fileName[0] = "short.txt";	// set up a short (fit in one page) blob/clob
+		fileName[1] = "littleclob.txt"; // set up a long (longer than a page) blob/clob
+		fileName[2] = "empty.txt"; // set up a blob/clob with nothing in it
+		fileName[3] = "searchclob.txt"; // set up a blob/clob to search with
+		fileName[4] = "aclob.txt"; // set up a really long (over 300K) blob/clob
+
+		for (int i = 0 ; i < numFiles; i++)
+		{
+			basefileName[i] = fileName[i];
+		}
 
         numRows = 10;
 
@@ -90,7 +101,8 @@
         unicodeStrings[2] = "\u05d0\u05d1\u05d2";
         numRowsUnicode = 6;
 
-        unicodeFileName = "extinout/unicodeFile.txt";
+        unicodeFilePath = "extinout";
+        unicodeFileName = "unicodeFile.txt";
     }
 
 
@@ -102,6 +114,21 @@
 
 		try
         {
+            // first check to see if the path to extin/out dir is ok.
+            sep = System.getProperty("file.separator");
+            boolean exists = (new File(filePath, fileName[0])).exists();
+            if (!exists)
+            {
+                String userDir = System.getProperty("user.dir");
+                filePath = userDir + sep + ".." + sep + filePath;
+                unicodeFilePath = userDir + sep + ".." + sep + unicodeFilePath;
+            }
+            for (int i=0; i < numFiles; i++) 
+            {
+                fileName[i] = filePath + sep + fileName[i];
+            }
+            unicodeFileName = unicodeFilePath + sep + unicodeFileName;
+
 			// use the ij utility to read the property file and
 			// make the initial connection.
 			ij.getPropertyArg(args);
@@ -180,9 +207,23 @@
             conn.commit();
             clobNegativeTest_Derby265(conn);
             blobNegativeTest_Derby265(conn);
+
+            // restart the connection for cleaning up
+            conn = ij.startJBMS();
+            String[] testObjects = {"table testclob_main", "table searchclob", 
+                                  "table testunicode", "table testunicode2", 
+                                  "table testclob10", "table testinteger", 
+                                  "table testclobcolumn", "table testclob2", 
+                                  "table testclob7", "table testlongrowclob", 
+                                  "table testblob", "table searchblob", 
+                                  "table testvarbinary", "table testinteger2", 
+                                  "table testblobcolumn", "table testblob2", 
+                                  "table testblobx", "table testlongrowblob", 
+                                  "table maps", "table maps_blob"};
+            Statement stmt = conn.createStatement();
+            TestUtil.cleanUpTest(stmt, testObjects);
             conn.close();
             System.out.println("FINISHED TEST blobclob :-)");
-
 		}
         catch (SQLException e)
         {
@@ -263,12 +304,12 @@
                 fileLength[i] = file.length();
 				/*
 				System.out.println("inserting filename[" +i +
-								   "]" + fileName[i] +
+								   "]" + basefileName[i] +
 								   " length: " + fileLength[i]);
 				*/
                 InputStream fileIn = new FileInputStream(file);
 
-                System.out.println("===> inserting " + fileName[i] + " length = "
+                System.out.println("===> inserting " + basefileName[i] + " length = "
 				    				   + fileLength[i]);
 
                 // insert a streaming column
@@ -348,10 +389,10 @@
 
 				/*
 				System.out.println("inserting filename[" +i +
-								   "]" + fileName[i] +
+								   "]" + basefileName[i] +
 								   " length: " + fileLength[i]);
 				*/
-                System.out.println("===> inserting " + fileName[i] + " length = "
+                System.out.println("===> inserting " + basefileName[i] + " length = "
 				    				   + fileLength[i]);
 
                 // insert a streaming column
@@ -2682,7 +2723,7 @@
                 fileLength[i] = file.length();
                 InputStream fileIn = new FileInputStream(file);
 
-                System.out.println("===> inserting " + fileName[i] + " length = "
+                System.out.println("===> inserting " + basefileName[i] + " length = "
 				    				   + fileLength[i]);
 
                 // insert a streaming column
@@ -2797,7 +2838,7 @@
                 fileLength[i] = file.length();
                 InputStream fileIn = new FileInputStream(file);
 
-                System.out.println("===> inserting " + fileName[i] + " length = "
+                System.out.println("===> inserting " + basefileName[i] + " length = "
 				    				   + fileLength[i]);
 
                 // insert a streaming column
@@ -4200,13 +4241,5 @@
 		return false;
 	}
 }
-
-
-
-
-
-
-
-
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java Thu Dec 22 09:26:55 2005
@@ -42,45 +42,20 @@
 
 public class checkDriver {
 
+	private static String hostName;
 	private static String EMBEDDED_URL = "jdbc:derby:wombat;create=true";
-	private static String CLIENT_URL = "jdbc:derby://localhost:1527/wombat;create=true";
-	private static String JCC_URL = "jdbc:derby:net://localhost:1527/wombat;create=true";
+	private static String CLIENT_URL;
+	private static String JCC_URL;
 	private static String INVALID_URL = "jdbc:db2j:wombat;create=true";
 	
 	private static String DERBY_SYSTEM_HOME = System.getProperty("derby.system.home");
 	
-	private static String CLIENT_URL_WITH_COLON1 = 
-		"jdbc:derby://localhost:1527/wombat:create=true";
-	private static String CLIENT_URL_WITH_COLON2 = 
-		"jdbc:derby://localhost:1527/"+ DERBY_SYSTEM_HOME + File.separator +"wombat:create=true";
-	private static String CLIENT_URL_WITH_DOUBLE_QUOTES1 = 
-		"jdbc:derby://localhost:1527/\"wombat\";create=true"; 
-	private static String CLIENT_URL_WITH_DOUBLE_QUOTES2 = 
-		"jdbc:derby://localhost:1527/\"" + DERBY_SYSTEM_HOME + File.separator + "wombat\";create=true";
-	private static String CLIENT_URL_WITH_SINGLE_QUOTES1 = 
-		"jdbc:derby://localhost:1527/'" + DERBY_SYSTEM_HOME + File.separator + "wombat';create=true";
-	private static String CLIENT_URL_WITH_SINGLE_QUOTES2 = 
-		"jdbc:derby://localhost:1527/'wombat';create=true";
-	
-	// URLS to check.  New urls need to also be added to the acceptsUrl table
-	private static String[] urls = new String[]
-	{
-	  	EMBEDDED_URL,
-		CLIENT_URL,
-		JCC_URL,
-		INVALID_URL,
-	};
-	
-	//Client URLS
-	private static String[] clientUrls = new String[]
-	{
-		CLIENT_URL_WITH_COLON1,
-		//CLIENT_URL_WITH_COLON2,
-		//CLIENT_URL_WITH_DOUBLE_QUOTES1,
-		//CLIENT_URL_WITH_DOUBLE_QUOTES2,
-		//CLIENT_URL_WITH_SINGLE_QUOTES1,
-		CLIENT_URL_WITH_SINGLE_QUOTES2
-	};
+	private static String CLIENT_URL_WITH_COLON1; 
+	private static String CLIENT_URL_WITH_COLON2;
+	private static String CLIENT_URL_WITH_DOUBLE_QUOTES1;  
+	private static String CLIENT_URL_WITH_DOUBLE_QUOTES2; 
+	private static String CLIENT_URL_WITH_SINGLE_QUOTES1; 
+	private static String CLIENT_URL_WITH_SINGLE_QUOTES2;
 	
 	/**
 	 * url prefix for this framework
@@ -91,7 +66,6 @@
 	// to check for valid results for each framework
 	private static int  frameworkOffset;
 	
-	
 	private static int EMBEDDED_OFFSET = 0;
 	private static int DERBYNETCLIENT_OFFSET = 1;
 	private static int DERBYNET_OFFSET = 2;   // JCC
@@ -104,7 +78,38 @@
 			frameworkOffset = DERBYNETCLIENT_OFFSET;
 		else if (TestUtil.isJCCFramework())
 			frameworkOffset = DERBYNET_OFFSET; // JCC
+		
+		hostName = TestUtil.getHostName();
+		CLIENT_URL = "jdbc:derby://" + hostName + ":1527/wombat;create=true";
+		JCC_URL = "jdbc:derby:net://" + hostName + ":1527/wombat;create=true";
+		CLIENT_URL_WITH_COLON1 = "jdbc:derby://" + hostName + ":1527/wombat:create=true";
+		CLIENT_URL_WITH_COLON2 = "jdbc:derby://" + hostName + ":1527/"+ DERBY_SYSTEM_HOME + File.separator +"wombat:create=true";
+		CLIENT_URL_WITH_DOUBLE_QUOTES1 = "jdbc:derby://" + hostName + ":1527/\"wombat\";create=true"; 
+		CLIENT_URL_WITH_DOUBLE_QUOTES2 = "jdbc:derby://" + hostName + ":1527/\"" + DERBY_SYSTEM_HOME + File.separator + "wombat\";create=true";
+		CLIENT_URL_WITH_SINGLE_QUOTES1 = "jdbc:derby://" + hostName + ":1527/'" + DERBY_SYSTEM_HOME + File.separator + "wombat';create=true";
+		CLIENT_URL_WITH_SINGLE_QUOTES2 = "jdbc:derby://" + hostName + ":1527/'wombat';create=true";
 	}
+
+	// URLS to check.  New urls need to also be added to the acceptsUrl table
+	private static String[] urls = new String[]
+	{
+	  	EMBEDDED_URL,
+		CLIENT_URL,
+		JCC_URL,
+		INVALID_URL,
+	};
+		
+	//Client URLS
+	private static String[] clientUrls = new String[]
+	{
+		CLIENT_URL_WITH_COLON1,
+		//CLIENT_URL_WITH_COLON2,
+		//CLIENT_URL_WITH_DOUBLE_QUOTES1,
+		//CLIENT_URL_WITH_DOUBLE_QUOTES2,
+		//CLIENT_URL_WITH_SINGLE_QUOTES1,
+		CLIENT_URL_WITH_SINGLE_QUOTES2
+	};
+	
 	
 	// Table that shows whether tested urls should return true for acceptsURL
 	// under the given framework
@@ -120,6 +125,7 @@
 			
 
 	public static void main(String[] args) {
+		
 		try {
 			Driver driver = loadAndCheckDriverForFramework();			
 			checkAcceptsURL(driver);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java Thu Dec 22 09:26:55 2005
@@ -44,6 +44,8 @@
    
 	static private boolean isDerbyNet = false;
 
+	static private String[] testObjects = {"TABLE TAB1"};
+
 	public static void main(String[] args) {
 		Connection conn, connreturn;
 		Statement stmt, stmtreturn;
@@ -58,6 +60,8 @@
 			 conn = ij.startJBMS();
 			 isDerbyNet = TestUtil.isNetFramework();
 			 stmt = conn.createStatement();
+			// cleanup table, just in case
+			TestUtil.cleanUpTest(stmt, testObjects);
             //create a table, insert a row, do a select from the table,
 			 stmt.execute("create table tab1("+
                                            "c1 char(100) for bit data,"+
@@ -162,6 +166,7 @@
 
             cs.close();
 			conn.close();
+			TestUtil.cleanUpTest(stmt, testObjects);
 
 		}
 		catch (SQLException e) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java Thu Dec 22 09:26:55 2005
@@ -24,6 +24,8 @@
 import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
 import org.apache.derby.jdbc.EmbeddedXADataSource;
 
+import java.util.Properties;
+
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.PreparedStatement;
@@ -44,6 +46,7 @@
 import javax.sql.ConnectionEvent;
 import org.apache.derby.tools.JDBCDisplayUtil;
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 import java.io.*;
 import java.util.Hashtable;
@@ -62,6 +65,7 @@
 
 		ij.getPropertyArg(args);
 		new dataSourcePermissions().runTest();
+		new dataSourcePermissions().cleanUp();
 		System.out.println("Completed dataSourcePermissions");
 
 	}
@@ -281,6 +285,7 @@
 
 		shutdown();
 		}
+
 	}
 
 	private static void checkConnection(Connection conn) throws SQLException {
@@ -372,4 +377,47 @@
 			System.out.println("EXPECTED SHUTDOWN " + sqle.getMessage());
 		}
 	}
+
+	protected void cleanUp() throws Exception {
+		// clear up in case this test gets run with useprocess=false
+		try {
+			TestUtil.loadDriver();
+			Connection conn = DriverManager.getConnection(getJDBCUrl("wombat", "user=EDWARD;password=noodle"));
+			CallableStatement cs = conn.prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
+			start();
+
+			cs.setString(1, "derby.connection.requireAuthentication");
+			cs.setString(2, "false");
+			cs.execute();
+			cs.close();
+
+			shutdown();
+			start();
+
+			conn = DriverManager.getConnection(getJDBCUrl("wombat", "user=EDWARD;password=noodle"));
+			cs = conn.prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
+
+			cs.setString(1, "derby.user.EDWARD");
+			cs.setNull(2, java.sql.Types.VARCHAR);
+			cs.execute();
+
+			cs.setString(1, "derby.user.FRANCES");
+			cs.setNull(2, java.sql.Types.VARCHAR);
+			cs.execute();
+
+			cs.setString(1, "derby.user." + zeus);
+			cs.setNull(2, java.sql.Types.VARCHAR);
+			cs.execute();
+
+			cs.close();
+
+			conn.close();
+			shutdown();
+		
+		} catch (SQLException sqle) {
+			System.out.println("UNEXPECTED CONNFAIL " + sqle.getMessage());
+			System.out.println("could not clean up");
+		}
+	}
+
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/lobStreams.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/lobStreams.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/lobStreams.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/lobStreams.java Thu Dec 22 09:26:55 2005
@@ -40,6 +40,7 @@
 public class lobStreams {
     
         static String[] fileName = new String[2];
+        static String sep;
         static long fileLength;
 
         static boolean debug = true;
@@ -47,14 +48,34 @@
 
         static
         {
-            fileName[0] = "extin/aclob.txt";
-            fileName[1] = "extin/littleclob.txt";
+//            fileName[0] = "extin" + sep + "aclob.txt";
+ //           fileName[1] = "extin" + sep + "littleclob.txt";
+            fileName[0] =  "aclob.txt";
+            fileName[1] =  "littleclob.txt";
         }
         
         public static void main(String[] args)
         {
             System.out.println("Test lob stream with multiple writes starting");
 
+            // check to see if we have the correct extin path, if the files aren't right here, try one more time
+	    boolean exists = (new File("extin", fileName[0])).exists();
+            String sep =  System.getProperty("file.separator");
+	    if (!exists) 
+            {
+                // assume it's in a dir up, if that's wrong too, too bad...
+                String userdir =  System.getProperty("user.dir");
+                fileName[0] = userdir + sep + ".." + sep + "extin" + sep + fileName[0];
+                fileName[1] = userdir + sep + ".." + sep + "extin" + sep + fileName[1];
+            }
+            else
+            {
+                // assume it's in a dir up, if that's wrong too, too bad...
+                fileName[0] = "extin" + sep + fileName[0];
+                fileName[1] = "extin" + sep + fileName[1];
+            }
+
+
             try
             {
                 // use the ij utility to read the property file and
@@ -76,6 +97,8 @@
 
                 // restart the connection
                 conn.commit();
+                cleanUp(conn);
+                conn.commit();
                 conn.close();
                 System.out.println("FINISHED TEST blobSetBinaryStream :-)");
 
@@ -443,4 +466,11 @@
             } 
             return true;
         }
+
+        private static void cleanUp(Connection conn) throws SQLException {
+            String[] testObjects = {"table testBlobX1"};
+            Statement cleanupStmt = conn.createStatement();
+            TestUtil.cleanUpTest(cleanupStmt, testObjects);
+        }
+
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java Thu Dec 22 09:26:55 2005
@@ -61,6 +61,10 @@
 		Connection conn;
 		Statement stmt;
 
+		// start by cleaning up, just in case
+		String[] testObjects = {"table tab1", "table tab2"};
+		
+
 		System.out.println("Test MaxFieldSize  starting");
 
 		isDerbyNet = TestUtil.isNetFramework();
@@ -71,6 +75,7 @@
 			 ij.getPropertyArg(args);
 			 conn = ij.startJBMS();
 			 stmt = conn.createStatement();
+			 TestUtil.cleanUpTest(stmt, testObjects);
             //create a table, insert a row, do a select from the table,
 			 stmt.execute("create table tab1("+
                                            "c1 char(100) for bit data,"+
@@ -163,6 +168,8 @@
 
 			testSort(conn, stmt);
 
+			TestUtil.cleanUpTest(stmt, testObjects);
+
 			stmt.close();
 			conn.close();
 
@@ -312,5 +319,11 @@
 			se = se.getNextException();
         }
     }
+
+	static private void cleanUp(Connection conn) throws SQLException
+	{
+		
+	}
+
 
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java Thu Dec 22 09:26:55 2005
@@ -39,6 +39,7 @@
 import java.util.StringTokenizer;
 
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
  * Test of database meta-data.  This program simply calls each of the meta-data
@@ -1062,24 +1063,14 @@
 				" parameter style java"); 
             	s.execute("call isReadO()");
             }
-			s.execute("drop procedure isReadO");
-			s.execute("drop procedure GETPCTEST4Bx");
-			s.execute("drop procedure GETPCTEST4B");
-			s.execute("drop procedure GETPCTEST4A");
-			s.execute("drop procedure GETPCTEST3B");
-			s.execute("drop procedure GETPCTEST3A");
-			s.execute("drop procedure GETPCTEST2");
-			s.execute("drop procedure GETPCTEST1");
-			s.execute("drop table t");
-			s.execute("drop table reftab");
-			s.execute("drop table reftab2");
-			s.execute("drop view SCREWIE");
-			s.execute("drop table louie");
-			s.execute("drop table alltypes");
+			cleanUp(s);
+	
 			s.close();
+
 			if (con.getAutoCommit() == false)
 				con.commit();
 
+			
 			con.close();
 
 		}
@@ -1278,5 +1269,18 @@
 		return con;
 
 	}
+
+	protected void cleanUp(Statement stmt) throws SQLException {
+		con.setAutoCommit(true);
+		String[] testObjects = {"table t", "table t1", "view screwie", 
+			"table reftab", "table reftab2", "table inflight" , "table alltypes", 
+			"table louie",
+			"procedure getpctest1", "procedure getpctest2",
+			"procedure getpctest3a", "procedure getpctest3b",
+			"procedure getpctest4a", "procedure getpctest4b", "procedure getpctest4bx",
+			"procedure isreadO" };
+		TestUtil.cleanUpTest(stmt, testObjects);
+	}
+
 }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java Thu Dec 22 09:26:55 2005
@@ -199,7 +199,7 @@
 			st.execute("drop table t1");
 		} catch (SQLException se) {}
 		try {
-			st.execute("drop procedure proc1");
+			st.execute("drop procedure za");
 		} catch (SQLException se) {}
 
 		st.close();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java Thu Dec 22 09:26:55 2005
@@ -44,6 +44,8 @@
 
 public class parameterMetaDataJdbc30 {
 	private static boolean isDerbyNet;
+	private static String[] testObjects = { "TABLE  T", "FUNCTION RDB",
+					 "PROCEDURE DUMMYINT", "PROCEDURE DUMMY_NUMERIC_PROC"};
 	public static void main(String[] args) {
 		Connection con = null;
 		Statement  s;
@@ -65,6 +67,7 @@
 			s = con.createStatement();
 
 			/* Create the table and do any other set-up */
+			TestUtil.cleanUpTest(s, testObjects);
 			setUpTest(s);
 
       s.executeUpdate("create function RDB(P1 INT) RETURNS DECIMAL(10,2) language java external name 'org.apache.derbyTesting.functionTests.tests.lang.outparams30.returnsBigDecimal' parameter style java");
@@ -181,6 +184,7 @@
       ps.execute();
 
       cs.close();
+      ps.close();    
 
       System.out.println("test: the scale returned should be the one set by registerOutParameter");
       s.executeUpdate("create procedure dummy_numeric_Proc(out a NUMERIC(30,15), out b NUMERIC(30,15)) language java parameter style java external name 'org.apache.derbyTesting.functionTests.tests.jdbcapi.parameterMetaDataJdbc30.dummy_numeric_Proc'");
@@ -252,6 +256,13 @@
 	  cs.close();
 	  s.execute("DROP PROCEDURE PMDD");
       }
+     s.close();
+     con = ij.startJBMS();
+     con.setAutoCommit(true); // make sure it is true
+     s = con.createStatement();
+	 TestUtil.cleanUpTest(s, testObjects);
+     s.close();
+     con.close();
      }
 	 catch (SQLException e) {
 	 dumpSQLExceptions(e);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java Thu Dec 22 09:26:55 2005
@@ -140,6 +140,7 @@
 
 			// clean up
 			executeStmt(con,"drop table ab");
+			executeStmt(con,"drop table bug4579");
 
 			con.close();
 		}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java Thu Dec 22 09:26:55 2005
@@ -6,6 +6,8 @@
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
 
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
 public class prepStmtNull {
 
     public static void main(String[] args) {
@@ -51,6 +53,9 @@
 			   System.out.println("ResultSet is: "+rs.getObject(1));
 			   System.out.println("ResultSet is: "+rs.getObject(2));
 			}
+			String[] testObjects = {"table nullTS"};
+                        TestUtil.cleanUpTest(stmt1, testObjects);
+   			con.commit();
  		} catch(SQLException sqle) {
  		   dumpSQLExceptions(sqle);
  		   sqle.printStackTrace();
@@ -99,6 +104,9 @@
 			   System.out.println("ResultSet is: "+rs.getObject(1));
 			   System.out.println("ResultSet is: "+rs.getObject(2));
 			}
+			String[] testObjects = {"table nullBlob"};
+                        TestUtil.cleanUpTest(stmt1, testObjects);
+   			con.commit();
  		} catch(SQLException sqle) {
  		   dumpSQLExceptions(sqle);
  		   sqle.printStackTrace();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java Thu Dec 22 09:26:55 2005
@@ -166,6 +166,11 @@
 			stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
 									   ResultSet.CONCUR_UPDATABLE);
 
+            try { 
+                stmt.execute("drop table t"); 
+            } catch (SQLException se) {
+            } // ignore, assume it is because table does not exist
+
 			stmt.execute("create table t (i int, s smallint, r real, "+
 				"d double precision, dt date, t time, ts timestamp, "+
 				"c char(10), v varchar(40) not null, dc dec(10,2),"+
@@ -597,7 +602,8 @@
 			System.out.println("rollback with auto commit");
 			showLocksForAutoCommitSelect(con, stmt, 2);
 
-
+            stmt.execute("drop table bug4810");
+			con.commit();
 			stmt.close();
 
 			testMutableValues(con);
@@ -877,6 +883,13 @@
 		System.out.println("Schema name of first column is " + met.getSchemaName(1));
 		System.out.println("Table name of second column is " + met.getTableName(2));
 		System.out.println("Schema name of second column is " + met.getSchemaName(2));
+        stmt.execute("drop table s");
+        stmt.execute("drop table s1.t1");
+        stmt.execute("drop schema s1 restrict");
+        stmt.execute("drop table app1.t1");
+        stmt.execute("drop table app2.t1");
+        stmt.execute("drop schema app2 restrict");
+        stmt.execute("drop schema app1 restrict");
 	}
 
 	static private void doTheTests() throws Exception

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java?rev=358591&r1=358590&r2=358591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java Thu Dec 22 09:26:55 2005
@@ -31,6 +31,8 @@
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
 
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
 /**
  * Test of additional methods in JDBC2.0 result set meta-data.
  * This program simply calls each of the additional result set meta-data
@@ -39,11 +41,13 @@
  */
 
 public class resultsetJdbc20 { 
+	private static String[] testObjects = { "TABLE T"};
 	public static void main(String[] args) {
 		Connection con;
 		ResultSetMetaData met;
 		ResultSet rs;
 		Statement stmt;
+		
 		String[]  columnNames = {"i", "s", "r", "d", "dt", "t", "ts", "c", "v", "dc"};
 
 		System.out.println("Test resultsetJdbc20 starting");
@@ -55,6 +59,8 @@
 			ij.getPropertyArg(args);
 			con = ij.startJBMS();
 			stmt = con.createStatement();
+			// first clean up
+			TestUtil.cleanUpTest(stmt, testObjects);
 
       //create a table, insert a row, do a select from the table,
       //get the resultset meta data and go through each column in
@@ -91,6 +97,7 @@
 
 			rs.close();
 
+			TestUtil.cleanUpTest(stmt, testObjects);
 			stmt.close();
 			con.close();
 



Mime
View raw message