You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2005/01/17 23:23:28 UTC

svn commit: r125447 - in incubator/derby/code/trunk/java: testing/org/apache/derbyTesting/functionTests/harness testing/org/apache/derbyTesting/functionTests/suites testing/org/apache/derbyTesting/functionTests/tests/derbynet testing/org/apache/derbyTesting/functionTests/tests/jdbcapi testing/org/apache/derbyTesting/functionTests/tests/lang testing/org/apache/derbyTesting/functionTests/tests/tools testing/org/apache/derbyTesting/functionTests/util tools/org/apache/derby/impl/tools/ij tools/org/apache/derby/tools

Author: kmarsden
Date: Mon Jan 17 14:23:26 2005
New Revision: 125447

URL: http://svn.apache.org/viewcvs?view=rev&rev=125447
Log:
Preparation work for Derby Network Client 
Add test harness hooks for new testing framework for Derby Network Client
Update existing network server tests to work with new driver once it is 
available

ij.startJBMS() has been changed to recognize the driver name and 
TestUtil has methods to allow tests to access framework specific information
in a generic way.

Framework = DerbyNetClient
Driver = org.apache.derby.jdbc.ClientDriver
URL = jdbc:derby://server[:port]/databaseName[;attributeKey=value]..
 


Added:
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetclientmats.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNetClient.runall   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql   (contents, props changed)
Modified:
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/FileCompare.java	Mon Jan 17 14:23:26 2005
@@ -45,10 +45,10 @@
     private boolean searchJdk12 = false;
     private boolean searchJdk13 = false;
     private boolean searchJdk14 = false;
-    private int jccMajor = 0;
-    private int jccMinor = 0;
+    private int driverVersionMajor = 0;
+    private int driverVersionMinor = 0;
     private boolean searchFrame;
-    private boolean searchJCC;
+    private boolean searchDriverVersion;
     private InputStream master = null;
     private boolean verbose;
     
@@ -76,9 +76,9 @@
         StringBuffer sb = new StringBuffer();
  
         // If framework is DerbyNet, we may need to check subdirs of the master canon dir
-        // for specific masters by version of JCC we're running against. So, get JCC version
+        // for specific masters by client  we're running against. So, get version
         // for later use if that is the case.
-        if (framework.equals("DerbyNet"))
+        if (framework.startsWith("DerbyNet"))
         {
 	  Class c = null;
 	  Method m = null;
@@ -86,22 +86,24 @@
 	  Integer i = null;
 	  try	
 	  {
-	    c = Class.forName("com.ibm.db2.jcc.DB2Driver");
+	    c = Class.forName(NetServer.getDriverName(framework));
 	    o = c.newInstance();
 	    m = c.getMethod("getMajorVersion", null);
 	    i = (Integer)m.invoke(o, null);
-	    jccMajor = i.intValue();
+	    driverVersionMajor = i.intValue();
 	    m = c.getMethod("getMinorVersion", null);
 	    i = (Integer)m.invoke(o, null);
-	    jccMinor = i.intValue();
-            if (framework.equals("DerbyNet")) searchJCC = true;
+	    driverVersionMinor = i.intValue();
+            if (framework.startsWith("DerbyNet")) searchDriverVersion = true;
 	  } catch ( Exception e )
 	  {
-	    //if anything goes wrong, make sure the JCC version values are set to zero
+	    //if anything goes wrong, make sure the driver version values are set to zero
 	    //forget about it.
-	   jccMinor = 0;
-	   jccMajor = 0;
-           searchJCC = false;
+		  
+		  System.out.println("Cannot determine driver version:" + e);
+		  driverVersionMinor = 0;
+		  driverVersionMajor = 0;
+		  searchDriverVersion = false;
  	  }
         }
         
@@ -187,7 +189,7 @@
         }
 		// compress blanks in output columns to make up for column width differences
 		// for JCC output
-		if (NetServer.isJCCConnection(framework))
+		if (NetServer.isClientConnection(framework))
 		{
             try
             {
@@ -358,7 +360,7 @@
 	String prefix = canondir + '/';
 	if (master == null && searchFrame) searchFramework(prefix);
         if (master == null) searchJvm(prefix);
-	if (master == null && searchJCC) searchJCCVersion(prefix);
+	if (master == null && searchDriverVersion) searchDriverVersion(prefix);
 	if (master == null) getmaster(prefix);
 	if (master == null && canondir != "master") searchCanondir("master");
     }
@@ -368,7 +370,7 @@
 	// The JVM search follows the following pattern, with one exception:
 	// first search jvmName (to support unnamed/non-IBM or Sun JVMs)
 	// if vendor == IBM, search ibm+rev then jdk+rev, decrementing rev by one until rev=13,
-	// in each dir, search framework and jcc version if applicable.
+	// in each dir, search framework and driver version if applicable.
 	// BUT, if it's j9, search j9_foundation then j9_13 if j9_foundation, or j9_13 for j9_13, then 	       // the normal ibm13 search pattern: ibm13 then jdk13.
 
 	String newprefix;
@@ -377,11 +379,11 @@
 	    if (jvmName.startsWith("j9_foundation"))
             {
                 newprefix = prefix + "j9_foundation" + '/';
-		if (master == null && searchJCC) searchJCCVersion(newprefix);
+		if (master == null && searchDriverVersion) searchDriverVersion(newprefix);
 		if (master == null) getmaster(newprefix);
             }
             newprefix = prefix + "j9_13" + '/';
-	    if (master == null && searchJCC) searchJCCVersion(newprefix);
+	    if (master == null && searchDriverVersion) searchDriverVersion(newprefix);
 	    if (master == null) getmaster(newprefix);
 	    
 	}
@@ -390,11 +392,11 @@
 	    if (jvmName.startsWith("ibm"))
             {
 		newprefix = prefix + "ibm1" + i + '/';
-		if (master == null && searchJCC) searchJCCVersion(newprefix);
+		if (master == null && searchDriverVersion) searchDriverVersion(newprefix);
 		if (master == null) getmaster(newprefix);
 	    }
 	    newprefix = prefix + "jdk1" + i + '/';
-	    if (master == null && searchJCC) searchJCCVersion(newprefix);
+	    if (master == null && searchDriverVersion) searchDriverVersion(newprefix);
 	    if (master == null) getmaster(newprefix);
         } 
     }
@@ -404,20 +406,20 @@
         String newprefix;
 	newprefix = prefix + framework + '/';
 	if (master == null) searchJvm(newprefix);
-	if (master == null && searchJCC) searchJCCVersion(newprefix);
+	if (master == null && searchDriverVersion) searchDriverVersion(newprefix);
 	if (master == null) getmaster(newprefix);
     }
 
-    private void searchJCCVersion(String prefix)
+    private void searchDriverVersion(String prefix)
     {
-	// It is not sufficient to simply search the current JCC version. 
-	// We must search down through the JCC versions to find the newest applicable master. 
+	// It is not sufficient to simply search the current driver version. 
+	// We must search down through the versions to find the newest applicable master. 
         
 	String newprefix;
 	
-	for (int j = ((jccMajor * 10) + jccMinor); j >= 10; j--)
+	for (int j = ((driverVersionMajor * 10) + driverVersionMinor); j >= 10; j--)
 	{
-            newprefix = prefix + "jcc" + j / 10 + "." + j % 10 + '/';
+            newprefix = prefix + "ver" + j / 10 + "." + j % 10 + '/';
 	    if (master == null) getmaster(newprefix); 
         }
     }

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java	Mon Jan 17 14:23:26 2005
@@ -81,6 +81,17 @@
 			   "shutdown"},
 	     null});                                        //shutdown2
 
+	m.put("DerbyNetClient", new Object[]
+	    {"jdbc:derby://localhost:1527/",                 //prefix
+	     "",                                            // suffix
+	     "org.apache.derby.jdbc.ClientDriver",           //driver
+	     "1527",                                        // port
+	     new String[] {NETWORK_SERVER_CLASS_NAME,  //start
+			   "start"},                        
+	     new String[] {NETWORK_SERVER_CLASS_NAME,  //shutdown
+			   "shutdown"},
+	     null});                                        //shutdown2
+
 	m.put("DB2jcc", new Object[]
 	    {"jdbc:db2://localhost:50000/",                //prefix
 	     "",                                            //suffix
@@ -352,12 +363,12 @@
 
 	public static boolean isNetworkServerConnection(String fm)
 	{
-		return (fm.equals("DerbyNet"));
+		return (fm.startsWith("DerbyNet"));
 	}
 
-    public static boolean isJCCConnection(String fm)
+    public static boolean isClientConnection(String fm)
     {
-	return (fm.equals("DerbyNet") ||
+	return (fm.startsWith("DerbyNet") ||
 		fm.equals("DB2jcc"));
     }
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java	Mon Jan 17 14:23:26 2005
@@ -68,7 +68,7 @@
     
     // Framework support
     static String[] validFrameworks = {"embedded","",
-				       "DerbyNet","DB2jcc",
+				       "DerbyNet","DerbyNetClient", "DB2jcc",
 				       "DB2app"};
     static NetServer ns;
     static boolean frameworkInitialized = false;
@@ -254,7 +254,7 @@
 	    if ((driverName != null) && (!skiptest) )
 	    {
             System.out.println("Initialize for framework: "+ framework );
-            if (j9net && (framework.equals("DerbyNet"))) 
+            if (j9net && (framework.startsWith("DerbyNet"))) 
 			    ns = new NetServer(baseDir, "j9_13", classpathServer, null, jvmflags,framework);
             else
 			    ns = new NetServer(baseDir, jvmName, classpathServer, javaCmd, jvmflags,framework);
@@ -307,7 +307,7 @@
                     {
                         Sed sed = new Sed();
                         sed.exec(tmpOutFile,finalOutFile, isSed, 
-                                        NetServer.isJCCConnection(framework));
+                                        NetServer.isClientConnection(framework));
 		    }
 		    catch (ClassFormatError cfe)
 		    {
@@ -715,7 +715,7 @@
 
         // Create a .tmp file for doing sed later to create testBase.out
         tmpOutFile = new File(outDir, testOutName + ".tmp");
-		if (NetServer.isJCCConnection(framework))
+		if (NetServer.isClientConnection(framework))
 		{
 			JCCOutName = testOutName+".tmpmstr";
 		}
@@ -751,7 +751,7 @@
         // Delete any old .out or .tmp files
         if (tmpOutFile.exists())
             status = tmpOutFile.delete();
-		if (NetServer.isJCCConnection(framework))
+		if (NetServer.isClientConnection(framework))
 		{
         	JCCOutFile = new File(outDir, JCCOutName);
         	if (JCCOutFile.exists())
@@ -1595,7 +1595,7 @@
 			
 		}
 		// Temporary until jcc supports null userid
-		if (NetServer.isJCCConnection(framework))
+		if (NetServer.isClientConnection(framework))
 		{
 			String user = System.getProperty("ij.user");
 			String password = System.getProperty("ij.password");
@@ -1727,7 +1727,7 @@
             if (skiptest == false)
                 status = diffFile.delete();
 			// delete JCC filtered master file
-			if (NetServer.isJCCConnection(framework))
+			if (NetServer.isClientConnection(framework))
 			{
         		JCCOutFile = new File(outDir, JCCOutName);
             	status = JCCOutFile.delete();

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties?view=auto&rev=125447
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties	Mon Jan 17 14:23:26 2005
@@ -0,0 +1,5 @@
+framework=DerbyNetClient
+suites=derbynetmats
+jdk12test=true
+runwithj9=false
+timeout=60

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetclientmats.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetclientmats.properties?view=auto&rev=125447
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetclientmats.properties	Mon Jan 17 14:23:26 2005
@@ -0,0 +1,9 @@
+framework=DerbyNetClient
+suites=j9derbynetmats
+jdk12test=true
+runwithj9=false
+runwithibm13=false
+runwithibm14=false
+runwithjdk13=false
+timeout=60
+serverJvm=j9

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNetClient.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNetClient.runall?view=auto&rev=125447
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNetClient.runall	Mon Jan 17 14:23:26 2005
@@ -0,0 +1 @@
+derbynet/dataSourcePermissions_net.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java	Mon Jan 17 14:23:26 2005
@@ -22,6 +22,7 @@
 
 import java.sql.*;
 import org.apache.derby.drda.NetworkServerControl;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 import java.net.InetAddress;
 import java.io.PrintWriter;
 
@@ -35,7 +36,7 @@
 
         // Load the Derby driver
         try {
-            Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
+			TestUtil.loadDriver();
             dbg("Derby drivers loaded");
         } catch (Exception e) {
             e.printStackTrace();
@@ -46,6 +47,7 @@
 		NetworkServerControl serverControl = null;
 		boolean started = false;
 
+
 		try {
 
 			serverControl = new
@@ -75,14 +77,15 @@
 			System.out.println("FAIL Network Server did not start");
 			return;
 		}
+		String jdbcUrlPrefix = TestUtil.getJdbcUrlPrefix("localhost", NETWORKSERVER_PORT);
+
+        String url = jdbcUrlPrefix + "/" + databaseFileName;
 
-        String url = "jdbc:derby:net://localhost:" + NETWORKSERVER_PORT + "/\"" + databaseFileName + "\"" + ":user=dummyUser;password=dummyPw;";
         Connection connection = null;
 		   
         try {
 			// Just connect, do something and close the connection
-            connection = DriverManager.getConnection(url);
-
+            connection = DriverManager.getConnection(url, "user", "password");
 			Statement stmt = connection.createStatement();
 			ResultSet rs = stmt.executeQuery("Select  tablename   from  sys.systables");
 			

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/badConnection.java	Mon Jan 17 14:23:26 2005
@@ -26,6 +26,7 @@
 
 import java.io.BufferedOutputStream;
 import org.apache.derbyTesting.functionTests.harness.TimedProcess;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
 	This tests various bad connection states
@@ -37,15 +38,17 @@
 	
 	private static Properties properties = new java.util.Properties();
 
-	private static String dbNotFoundUrl =
-		"jdbc:derby:net://localhost:1527/notthere";
-	private static String  invalidAttrUrl = "jdbc:derby:net://localhost:1527/testbase;upgrade=notValidValue";
-	private static String  derbynetUrl = "jdbc:derby:net://localhost:1527/testbase";
+	private static String dbNotFoundDB = "notthere";
+	private static String  invalidAttrDB = "testbase;upgrade=notValidValue";
+	private static String  derbynetDB = "testbase";
 
 
-	private static Connection newConn(String databaseURL,Properties properties) throws Exception
+	private static Connection newConn(String database,Properties properties) throws Exception
 	{
 		Connection conn = null;
+		String databaseURL = TestUtil.getJdbcUrlPrefix() + database;
+		//System.out.println("URL is: " + databaseURL);
+
 		try {
 			conn = DriverManager.getConnection(databaseURL, properties); 
 			if (conn == null)
@@ -76,21 +79,19 @@
 		
 		try
 		{
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-
+			TestUtil.loadDriver();
 			System.out.println("No user/password  (Client error)");
-			Connection conn1 = newConn(derbynetUrl, properties);
+			Connection conn1 = newConn(derbynetDB, properties);
 
 			System.out.println("Database not Found  (RDBNFNRM)");
 			properties.put ("user", "admin");
 			properties.put ("password", "admin");
-			conn1 = newConn(dbNotFoundUrl, properties);
+			conn1 = newConn(dbNotFoundDB, properties);
 			if (conn1 != null)
 				conn1.close();
 
 			System.out.println("Invalid Attribute  value (RDBAFLRM)");
-			conn1 = newConn(invalidAttrUrl, properties);
+			conn1 = newConn(invalidAttrDB, properties);
 			if (conn1 != null)
 				conn1.close();
 		

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java	Mon Jan 17 14:23:26 2005
@@ -32,7 +32,7 @@
 import java.sql.BatchUpdateException;
 import java.sql.DriverManager;
 import java.sql.Connection;
-
+import org.apache.derby.tools.ij;
 /**
 	This test tests the JDBC CallableStatement.
 */
@@ -45,17 +45,14 @@
 		try
 		{
 			System.out.println("CallableStatement Test Starts");
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			Connection conn = null;
 
-			// This also tests quoted pathname in database name portion of URL, beetle 4781.
-			String databaseURL = "jdbc:derby:net://localhost/\"" + System.getProperty("derby.system.home") + java.io.File.separator + "wombat;create=true\"";
-			java.util.Properties properties = new java.util.Properties();
-			properties.put ("user", "I");
-			properties.put ("password", "mine");
+			ij.getPropertyArg(args); 
 
-			conn = DriverManager.getConnection(databaseURL, properties);
+			// This also tests quoted pathname in database name portion of URL, beetle 4781.
+			String protocol = System.getProperty("ij.protocol");
+			System.setProperty("ij.database", protocol + "//localhost/\"" + System.getProperty("derby.system.home") + java.io.File.separator + "wombat;create=true\"");
+			ij.getPropertyArg(args); 
+			Connection conn = ij.startJBMS();
 			if (conn == null)
 			{
 				System.out.println("conn didn't work");

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java	Mon Jan 17 14:23:26 2005
@@ -29,6 +29,7 @@
 import java.sql.SQLException;
 import org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil;
 import org.apache.derby.impl.tools.ij.util;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
 	This tests to see if the security manager is running.
@@ -70,7 +71,7 @@
 			//    We seem to be able to create the database.
 			// Ideally this test should attempt to create the database
 			// ../wombat;create=true and get the security exception.
-			String databaseURL = "jdbc:derby:net://localhost/" + 
+			String databaseURL = TestUtil.getJdbcUrlPrefix() + "localhost/" + 
 				"\"D:/wombat;create=true\"";
 			System.out.println(databaseURL);
 			java.util.Properties properties = new java.util.Properties();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant	Mon Jan 17 14:23:26 2005
@@ -8,5 +8,6 @@
 runtimeinfo_sed.properties
 sysinfo_sed.properties
 testij.sql
+testclientij.sql
 testij_app.properties
 testij_sed.properties

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/csPrepStmt.java	Mon Jan 17 14:23:26 2005
@@ -33,6 +33,7 @@
 import java.io.ByteArrayInputStream; 
 import java.io.InputStreamReader;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derby.tools.ij;
 
 /**
 	This test tests the JDBC PreparedStatement.
@@ -49,17 +50,8 @@
 			System.out.println("csPrepStmt Test Starts");
 			// Initialize JavaCommonClient Driver.
 			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			
-
-			// test attribute passing in quoted string, beetle 4789
-			String databaseURL = "jdbc:derby:net://localhost/\"wombat2;create=true;upgrade=true\"";
-			java.util.Properties properties = new java.util.Properties();
-			properties.put ("user", "cs");
-			properties.put ("password", "cs");
-			properties.put("retrieveMessagesFromServerOnGetMessage", "true");
-
-			conn = DriverManager.getConnection(databaseURL, properties);
+			ij.getPropertyArg(args); 
+			conn = ij.startJBMS();
 			if (conn == null)
 			{
 				System.out.println("conn didn't work");

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/executeUpdate.java	Mon Jan 17 14:23:26 2005
@@ -25,6 +25,8 @@
 import java.sql.Statement;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+
+import org.apache.derby.tools.ij;
 /**
 	This test tests the JDBC Statement executeUpdate method. Since IJ will eventually
 	just use execute rather then executeUpdate, I want to make sure that executeUpdate
@@ -40,14 +42,8 @@
 		{
 			System.out.println("executeUpdate Test Starts");
 			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			Connection conn = null;
-
-			String databaseURL = "jdbc:derby:net://localhost/wombat;create=true";
-			java.util.Properties properties = new java.util.Properties();
-			properties.put ("user", "judy");
-			properties.put ("password", "judy");
-			conn = DriverManager.getConnection(databaseURL, properties);
+			ij.getPropertyArg(args); 
+			Connection conn = ij.startJBMS();
 			
 			if (conn == null)
 			{

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java	Mon Jan 17 14:23:26 2005
@@ -20,6 +20,8 @@
 package org.apache.derbyTesting.functionTests.tests.derbynet;
 
 import org.apache.derby.drda.NetworkServerControl;
+import org.apache.derby.tools.ij;
+
 import java.util.Properties;
 import java.sql.*;
 import java.util.Vector;
@@ -30,7 +32,6 @@
 
 public class getCurrentProperties
 {
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
 	private static Properties properties = new java.util.Properties();
 	private static Object joinsync = new Object();
 	private static boolean start = false;
@@ -41,6 +42,8 @@
 			NetworkServerControl server = new NetworkServerControl();
 			Properties p = server.getCurrentProperties();
 			p.list(System.out);
+			ij.getPropertyArg(args); 
+
 			// create a connection in a different thread
 			startConnection();
 			// wait for connection
@@ -71,10 +74,7 @@
 		Runnable service = new Runnable() {
 			public void run() {
 				try {
-					Class.forName("com.ibm.db2.jcc.DB2Driver");
-					properties.put ("user", "admin");
-					properties.put ("password", "admin");
-					Connection conn = DriverManager.getConnection(databaseURL, properties); 
+					Connection conn = ij.startJBMS();
 
 					// signal that connection has been established
 					joinsignal();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java	Mon Jan 17 14:23:26 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.derby.tools.ij;
 
 /**
 	This tests the maxthreads command
@@ -37,7 +38,6 @@
 
 public class maxthreads
 {
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
 	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
@@ -110,13 +110,7 @@
 			System.out.println("FAIL - max threads value is " + maxValue + " should be "
 				+ value);
 	}
-	private static Connection newConn() throws Exception
-	{
-		Connection conn = DriverManager.getConnection(databaseURL, properties); 
-		if (conn == null)
-			System.out.println("create connection didn't work");
-		return conn;
-	}
+
 
 	public static void main (String args[]) throws Exception
 	{
@@ -127,12 +121,9 @@
 		vCmd = jvm.getCommandLine();
 		try
 		{
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			properties.put ("user", "admin");
-			properties.put ("password", "admin");
+			ij.getPropertyArg(args); 
+			Connection conn1 = ij.startJBMS();
 
-			Connection conn1 = newConn();
         	bos = new BufferedOutputStream(System.out, 1024);
 
 			server = new NetworkServerControl();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java	Mon Jan 17 14:23:26 2005
@@ -33,6 +33,7 @@
 import java.io.ByteArrayInputStream; 
 import java.io.InputStreamReader;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derby.tools.ij;
 
 /**
 	This test tests the JDBC PreparedStatement.
@@ -47,16 +48,8 @@
 		try
 		{
 			System.out.println("prepStmt Test Starts");
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			Connection conn = null;
-			// test attribute passing in quoted string, beetle 4789
-			String databaseURL = "jdbc:derby:net://localhost/\"wombat2;create=true;upgrade=true\"";
-			java.util.Properties properties = new java.util.Properties();
-			properties.put ("user", "cs");
-			properties.put ("password", "cs");
-			properties.put("retrieveMessagesFromServerOnGetMessage", "true");
-			conn = DriverManager.getConnection(databaseURL, properties);
+			ij.getPropertyArg(args); 
+			conn = ij.startJBMS();
 
 			if (conn == null)
 			{

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java	Mon Jan 17 14:23:26 2005
@@ -39,7 +39,6 @@
 public class runtimeinfo
 {
 
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
 	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java	Mon Jan 17 14:23:26 2005
@@ -28,6 +28,7 @@
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derby.tools.ij;
 
 /**
 	This tests the sysinfo command
@@ -36,7 +37,6 @@
 public class sysinfo
 {
 
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
 	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
@@ -93,13 +93,6 @@
 
 	}
 
-	private static Connection newConn() throws Exception
-	{
-		Connection conn = DriverManager.getConnection(databaseURL, properties); 
-		if (conn == null)
-			System.out.println("create connection didn't work");
-		return conn;
-	}
 
 	public static void main (String args[]) throws Exception
 	{
@@ -110,12 +103,7 @@
 		vCmd = jvm.getCommandLine();
 		try
 		{
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			properties.put ("user", "admin");
-			properties.put ("password", "admin");
-
-			Connection conn1 = newConn();
+			Connection conn1 = ij.startJBMS();
 			/************************************************************
 			 *  Test sysinfo
 			 ************************************************************/

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql?view=auto&rev=125447
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testclientij.sql	Mon Jan 17 14:23:26 2005
@@ -0,0 +1,43 @@
+driver 'org.apache.derby.jdbc.ClientDriver';
+--Bug 4632  Make the db italian to make sure string selects  are working
+connect 'jdbc:derby://localhost:1527/wombat;create=true;territory=it:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadmin';
+
+connect 'jdbc:derby://localhost:1527/wombat' USER 'dbadmin' PASSWORD 'dbadbmin';
+-- this is a comment, a comment in front of a select should not cause an error
+select * from sys.systables where 1=0;
+-- this is a comment, a comment in front of a values clauses should not cause an error
+values(1);
+
+-- Try some URL attributes
+disconnect all;
+connect 'jdbc:derby://localhost:1527/junk;create=true:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+select * from APP.notthere;
+
+
+-- examples from the docs
+
+connect 'jdbc:derby://localhost:1527/wombat;create=true:user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
+
+connect 'jdbc:derby://localhost:1527/"./wombat":user=judy;password=judy;retrieveMessagesFromServerOnGetMessage=true;';
+
+connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;';
+
+
+connect 'jdbc:derby://localhost:1527/toursDB:retrieveMessagesFromServerOnGetMessage=true;' USER 'dbadmin' PASSWORD 'dbadbmin';
+
+connect 'jdbc:derby://localhost:1527/wombat' USER 'APP' PASSWORD 'APP';
+
+connect  'jdbc:derby://localhost:1527/my-db-name;create=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+
+connect 'jdbc:derby://localhost:1527/my-db-name;upgrade=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+
+
+connect 'jdbc:derby://localhost:1527/my-db-name;shutdown=true:user=usr;password=pwd;'
+
+-- Quoted db and attributes
+connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;';
+
+connect 'jdbc:derby://localhost:1527/"./my-dbname;create=true":user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;';
+
+
+

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testconnection.java	Mon Jan 17 14:23:26 2005
@@ -28,6 +28,7 @@
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derby.tools.ij;
 
 /**
 	This tests the testconnection command
@@ -36,8 +37,6 @@
 public class testconnection
 {
 
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
-	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
 	private static String[] TestConnectionCmd1 = new String[] {"org.apache.derby.drda.NetworkServerControl",
@@ -103,13 +102,6 @@
 
 	}
 
-	private static Connection newConn() throws Exception
-	{
-		Connection conn = DriverManager.getConnection(databaseURL, properties); 
-		if (conn == null)
-			System.out.println("create connection didn't work");
-		return conn;
-	}
 
 	public static void main (String args[]) throws Exception
 	{
@@ -120,12 +112,7 @@
 		vCmd = jvm.getCommandLine();
 		try
 		{
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			properties.put ("user", "admin");
-			properties.put ("password", "admin");
-
-			Connection conn1 = newConn();
+			Connection conn1 = ij.startJBMS();
         	bos = new BufferedOutputStream(System.out, 1024);
 
 			/************************************************************

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java	Mon Jan 17 14:23:26 2005
@@ -28,19 +28,23 @@
 
 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.drda.NetworkServerControl;
 
+
 public class testij
 {
 
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat";
+
 	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
-	private static String[] ijCmd = new String[] {"org.apache.derby.tools.ij",
+	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 void execCmd (String[] args) throws Exception
 	{
 		int totalSize = vCmd.size() + args.length;
@@ -127,7 +131,10 @@
 			//create wombat database
 			NetworkServerControl server = new NetworkServerControl();
 			System.out.println("Testing various ij connections and comments in front of selects");
-			execCmdDumpResults(ijCmd);	
+			if (TestUtil.isJCCFramework())
+				execCmdDumpResults(jccIjCmd);	
+			else   // Derby Client
+				execCmdDumpResults(clientIjCmd);	
 			System.out.println("End test");
 		}
 		catch (Exception e)

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties	Mon Jan 17 14:23:26 2005
@@ -19,5 +19,5 @@
 #
 #
 derby.optimizer.noTimeout=true
-supportfiles=tests/derbynet/testij.sql
+supportfiles=tests/derbynet/testij.sql,tests/derbynet/testclientij.sql
 useextdirs=true

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java	Mon Jan 17 14:23:26 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.derby.tools.ij;
 
 /**
 	This tests the timeslice command
@@ -38,8 +39,6 @@
 public class timeslice
 {
 
-	private static String databaseURL = "jdbc:derby:net://localhost:1527/wombat;create=true";
-	private static Properties properties = new java.util.Properties();
 	private static jvm jvm;
 	private static Vector vCmd;
 	private static String[] timesliceCmd1 = new String[] {"org.apache.derby.drda.NetworkServerControl",
@@ -111,13 +110,6 @@
 			System.out.println("FAIL - time slice value is " + timeSliceValue + " should be "
 				+ value);
 	}
-	private static Connection newConn() throws Exception
-	{
-		Connection conn = DriverManager.getConnection(databaseURL, properties); 
-		if (conn == null)
-			System.out.println("create connection didn't work");
-		return conn;
-	}
 
 	public static void main (String args[]) throws Exception
 	{
@@ -128,13 +120,7 @@
 		vCmd = jvm.getCommandLine();
 		try
 		{
-			// Initialize JavaCommonClient Driver.
-			Class.forName("com.ibm.db2.jcc.DB2Driver");
-			properties.put ("user", "admin");
-			properties.put ("password", "admin");
-
-			Connection conn1 = newConn();
-
+			Connection conn1 = ij.startJBMS();
         	bos = new BufferedOutputStream(System.out, 1024);
 
 			server = new NetworkServerControl();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java	Mon Jan 17 14:23:26 2005
@@ -33,6 +33,7 @@
 import java.sql.Types;
 import java.util.GregorianCalendar;
 import org.apache.derby.iapi.reference.JDBC20Translation;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 public class StmtCloseFunTest {
     
@@ -42,10 +43,8 @@
     public static void main(String[] args) {
 
 		System.out.println("Statement Close Fun Test starting ");
+		isDerbyNet= TestUtil.isNetFramework();
 
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
 
 		try {
 			// use the ij utility to read the property file and

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java	Mon Jan 17 14:23:26 2005
@@ -34,6 +34,8 @@
 import java.sql.Blob;
 
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
 import java.io.*;
 import java.sql.PreparedStatement;
 import java.util.Properties;
@@ -87,9 +89,7 @@
     {
 		System.out.println("Test blobclob starting");
 
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+		isDerbyNet = TestUtil.isNetFramework();
 
 		try
         {

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java	Mon Jan 17 14:23:26 2005
@@ -37,6 +37,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 public class characterStreams { 
 
@@ -44,10 +45,7 @@
 
 	public static void main(String[] args) {
 
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
-
+		isDerbyNet = TestUtil.isNetFramework();
 		if (isDerbyNet) {
 			System.out.println("SKIP TEST FOR NOW");
 			return;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java	Mon Jan 17 14:23:26 2005
@@ -33,6 +33,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
  *This Program Test getConnection()/getStatement().
@@ -46,9 +47,7 @@
 	public static void main(String[] args) {
 		Connection conn, connreturn;
 		Statement stmt, stmtreturn;
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+
 
 		System.out.println("Test connection20 starting");
 		try
@@ -57,6 +56,7 @@
 			// make the initial connection.
 			 ij.getPropertyArg(args);
 			 conn = ij.startJBMS();
+			 isDerbyNet = TestUtil.isNetFramework();
 			 stmt = conn.createStatement();
             //create a table, insert a row, do a select from the table,
 			 stmt.execute("create table tab1("+

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java	Mon Jan 17 14:23:26 2005
@@ -32,6 +32,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
  *This Program Test SetMaxFieldsize()/getMaxFieldsize().
@@ -62,10 +63,7 @@
 
 		System.out.println("Test MaxFieldSize  starting");
 
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
-		
+		isDerbyNet = TestUtil.isNetFramework();
 		try
 		{
 			// use the ij utility to read the property file and

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java	Mon Jan 17 14:23:26 2005
@@ -32,6 +32,7 @@
 import java.math.BigDecimal;
 
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
  * Test the new class ParameterMetaData in jdbc 30.
@@ -59,9 +60,7 @@
 			ij.getPropertyArg(args);
 			con = ij.startJBMS();
 			con.setAutoCommit(true); // make sure it is true
-			String framework = System.getProperty("framework");
-			if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+			isDerbyNet = TestUtil.isNetFramework();
 
 			s = con.createStatement();
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java	Mon Jan 17 14:23:26 2005
@@ -57,9 +57,7 @@
 
 	public static void main(String[] args) {
 
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+		isDerbyNet = TestUtil.isNetFramework();
 
 		Connection con;
 		ResultSetMetaData met;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java	Mon Jan 17 14:23:26 2005
@@ -30,7 +30,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
-
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 /**
  * Test the new class Savepoint in jdbc 30.
  * Also, test some mix and match of defining savepoints through JDBC and sql
@@ -55,9 +55,7 @@
 			// make the initial connection.
 			ij.getPropertyArg(args);
 			con = ij.startJBMS();
-			String framework = System.getProperty("framework");
-			if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-				isDerbyNet = true;
+			isDerbyNet = TestUtil.isNetFramework();
 
 			con.setAutoCommit(true); // make sure it is true
 			s = con.createStatement();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/casting.java	Mon Jan 17 14:23:26 2005
@@ -23,7 +23,7 @@
 import org.apache.derby.tools.ij;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derby.tools.JDBCDisplayUtil;
-
+ 
 import java.sql.*;
 import java.math.*;
 import java.io.*;
@@ -261,12 +261,10 @@
  
 	public static void main(String[] args) throws Exception {
 		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
-
 		if (framework != null && framework.toUpperCase().equals("DB2JCC"))
 			isDB2 = true;
 
+		isDerbyNet = TestUtil.isNetFramework();
 		try {
 			// use the ij utility to read the property file and
 			// make the initial connection.

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/declareGlobalTempTableJavaJDBC30.java	Mon Jan 17 14:23:26 2005
@@ -35,7 +35,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
-
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 /**
  * Test for declared global temporary tables (introduced in Cloudscape 5.2) and pooled connection close and jdbc 3.0 specific features
  * The jdbc3.0 specific featuers are holdable cursors, savepoints.
@@ -70,9 +70,7 @@
       
 			ij.getPropertyArg(args);
 			con = ij.startJBMS();
-			String framework = System.getProperty("framework");
-			if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-				isDerbyNet = true;
+			isDerbyNet = TestUtil.isNetFramework();
 
 			con.setAutoCommit(false);
 			s = con.createStatement();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedure.java	Mon Jan 17 14:23:26 2005
@@ -45,9 +45,7 @@
 	{
    		ij.getPropertyArg(argv); 
         Connection conn = ij.startJBMS();
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+		isDerbyNet = TestUtil.isNetFramework();
 
 		// DB2 !!
 		// com.ibm.db2.jcc.DB2DataSource ds = new com.ibm.db2.jcc.DB2DataSource();

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java	Mon Jan 17 14:23:26 2005
@@ -27,7 +27,7 @@
 import java.math.BigDecimal;
 
 import org.apache.derbyTesting.functionTests.tests.jdbcapi.parameterMetaDataJdbc30;
-
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 public class procedureJdbc30
 { 
 
@@ -37,10 +37,7 @@
 	{
    		ij.getPropertyArg(argv); 
         Connection conn = ij.startJBMS();
-
-		String framework = System.getProperty("framework");
-		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
-			isDerbyNet = true;
+		isDerbyNet = TestUtil.isNetFramework();
 
         runTests( conn);
     }

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java	Mon Jan 17 14:23:26 2005
@@ -38,7 +38,11 @@
 import java.io.File;
 
 import org.apache.derby.tools.dblook;
+import org.apache.derby.tools.ij;
 import org.apache.derby.catalog.DependableFinder;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
+
 
 import java.util.HashMap;
 import java.util.TreeMap;
@@ -68,7 +72,6 @@
 
 	/* **********************************************
 	 * main:
-	 * @param args Ignored.
 	 ****/
 
 	public static void main (String[] args) {
@@ -383,9 +386,7 @@
 
 		printAsHeader("\nDumping DDL for all objects, " +
 			"using\nNetwork Server:\n");
- 
-		jdbcProtocol = "jdbc:derby:net://localhost:" +
-			SERVER_PORT + "/";
+		jdbcProtocol = TestUtil.getJdbcUrlPrefix("localhost",SERVER_PORT);
 		String sourceDBUrl = jdbcProtocol + "\"" + dbPath +
 			separator + dbName + "\":user=someusr;password=somepwd;";
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java&r1=125446&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java	Mon Jan 17 14:23:26 2005
@@ -23,14 +23,190 @@
 
 import java.sql.*;
 import java.io.*;
+import java.util.Locale;
 import org.apache.derby.iapi.reference.JDBC30Translation;
 
 
 /**
-	Utility methods for tests, in order to bring some consistency to test output.
+	Utility methods for tests, in order to bring some consistency to test
+	output and handle testing framework differences
+
 */
 public class TestUtil {
 
+	public static final int UNKNOWN_FRAMEWORK = -1;
+
+	/**
+	   framework = embedded (or null) jdbc:derby:
+	*/
+	public static final int EMBEDDED_FRAMEWORK = 0;
+	
+	/**
+	   framework = DerbyNet for JCC  jdbc:derby:net:
+	*/
+	public static final int DERBY_NET_FRAMEWORK = 1;
+
+	/**
+	   framework = DB2JCC  for testing JCC against DB2 for 
+	   debugging jcc problems jdbc:db2://
+	*/
+
+	public  static final int DB2JCC_FRAMEWORK = 2; // jdbc:db2//
+	
+	/**
+	   framework = DerbyNetClient  for Derby cient  jdbc:derby://
+	*/
+	public static final int DERBY_NET_CLIENT_FRAMEWORK = 3; // jdbc:derby://
+
+
+	/**
+	   framework = DB2jNet 
+	   OLD_NET_FRAMEWORK is for tests that have not yet been contributed.
+	   it can be removed once all tests are at apache
+	*/
+	public  static final int OLD_NET_FRAMEWORK = 4;          // jdbc:derby:net:
+
+
+	private static int framework = UNKNOWN_FRAMEWORK;
+
+	// Methods for making framework dependent decisions in tests.
+
+	/**
+	 * Is this a network testingframework? 
+	 * return true if the System Property framework is set to Derby Network
+	 * client or JCC
+	 *
+	 * @return true if this is a Network Server test
+	 */
+	public static boolean isNetFramework()
+	{
+		framework = getFramework();
+		switch (framework)
+		{
+			case DERBY_NET_FRAMEWORK:
+			case DERBY_NET_CLIENT_FRAMEWORK:
+			case DB2JCC_FRAMEWORK:
+			case OLD_NET_FRAMEWORK:
+				return true;
+			default:
+				return false;
+		}
+	}
+			
+	/** 
+		Is the JCC driver being used
+	  
+		@return true for JCC driver
+	*/
+	public static boolean isJCCFramework()
+	{
+		int framework = getFramework();
+		switch (framework)
+		{
+			case DERBY_NET_FRAMEWORK:
+			case DB2JCC_FRAMEWORK:
+			case OLD_NET_FRAMEWORK:
+				return true;
+		}
+		return false;
+	}
+
+	/**
+	   Get the framework from the System Property framework
+	   @return  constant for framework being used
+	       TestUtil.EMBEDDED_FRAMEWORK  for embedded
+		   TestUtil.DERBY_NET_CLIENT_FRAMEWORK  for Derby Network Client 
+		   TestUtil.DERBY_NET_FRAMEWORK for JCC to Network Server
+		   TestUtil.DB2JCC_FRAMEWORK for JCC to DB2
+	*/
+	private static int getFramework()
+	{
+		if (framework != UNKNOWN_FRAMEWORK)
+			return framework;
+		String frameworkString = System.getProperty("framework");
+		if (frameworkString == null || 
+		   frameworkString.toUpperCase(Locale.ENGLISH).equals("EMBEDDED"))
+			framework = EMBEDDED_FRAMEWORK;
+		else if (frameworkString.toUpperCase(Locale.ENGLISH).equals("DERBYNETCLIENT"))
+			framework = DERBY_NET_CLIENT_FRAMEWORK;
+		else if (frameworkString.toUpperCase(Locale.ENGLISH).equals("DERBYNET"))
+			framework = DERBY_NET_FRAMEWORK;
+		else if (frameworkString.toUpperCase(Locale.ENGLISH).indexOf("DB2JNET") != -1)
+			framework = OLD_NET_FRAMEWORK;
+
+		return framework;
+
+	}
+
+	/**
+	    Get URL prefix for current framework.
+		
+		@return url, assume localhost and port 1527 for Network Tests
+		@see getJdbcUrlPrefix(String server, int port)
+		
+	*/
+	public static String getJdbcUrlPrefix()
+	{
+		return getJdbcUrlPrefix("localhost", 1527);
+	}
+
+	/** 
+		Get URL prefix for current framework		
+		
+		@param server  host to connect to with client driver 
+		               ignored for embedded driver
+		@param port    port to connect to with client driver
+		               ignored with embedded driver
+		@return URL prefix
+		        EMBEDDED_FRAMEWORK returns "jdbc:derby"
+				DERBY_NET_FRAMEWORK = "jdbc:derby:net://<server>:port/"
+				DERBY_NET_CLIENT_FRAMEWORK = "jdbc:derby://<server>:port/"
+				DB2_JCC_FRAMEWORK = "jdbc:db2://<server>:port/"
+	*/
+	public static String getJdbcUrlPrefix(String server, int port)
+	{
+		int framework = getFramework();
+		switch (framework)
+		{
+			case EMBEDDED_FRAMEWORK:
+				return "jdbc:derby:";
+			case DERBY_NET_FRAMEWORK:
+			case OLD_NET_FRAMEWORK:								
+				return "jdbc:derby:net://" + server + ":" + port + "/";
+			case DERBY_NET_CLIENT_FRAMEWORK:
+				return "jdbc:derby://" + server + ":" + port + "/";
+			case DB2JCC_FRAMEWORK:				
+				return "jdbc:db2://" + server + ":" + port + "/";
+		}
+		// Unknown framework
+		return null;
+		
+	}
+
+	/**
+	   Load the appropriate driver for the current framework
+	*/
+	public static void loadDriver() throws Exception
+	{
+		String driverName = null;
+		framework = getFramework();
+		switch (framework)
+		{
+			case EMBEDDED_FRAMEWORK:
+				driverName =  "org.apache.derby.jdbc.EmbeddedDriver";
+				break;
+			case DERBY_NET_FRAMEWORK:
+			case OLD_NET_FRAMEWORK:				
+			case DB2JCC_FRAMEWORK:				
+				driverName = "com.ibm.db2.jcc.DB2Driver";
+				break;
+			case DERBY_NET_CLIENT_FRAMEWORK:
+				driverName = "org.apache.derby.jdbc.ClientDriver";
+				break;
+		}
+		Class.forName(driverName).newInstance();
+	}
+
 	public static void dumpSQLExceptions(SQLException sqle) {
 		TestUtil.dumpSQLExceptions(sqle, false);
 	}
@@ -288,6 +464,11 @@
 
 
 }
+
+
+
+
+
 
 
 

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java&r1=125446&p2=incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java	Mon Jan 17 14:23:26 2005
@@ -141,12 +141,20 @@
 			// for network server need to alter url
 			String framework = p.getProperty("framework");
 			
-			if (framework != null && framework.equals("DB2jNet"))
-			{
-				String newURLPrefix= "jdbc:derby:net://localhost:1527/";
-				updateURLProperties(p,newURLPrefix);
-				p.setProperty("ij.user","APP");
-				p.setProperty("ij.password","PWD");
+			if (framework != null)
+				{
+					String newURLPrefix = null;
+					framework = framework.toUpperCase(java.util.Locale.ENGLISH);
+					if (framework.equals("DB2JNET") || framework.equals("DERBYNET"))
+						newURLPrefix= "jdbc:derby:net://localhost:1527/";
+					else if (framework.equals("DERBYNETCLIENT"))
+						newURLPrefix= "jdbc:derby://localhost:1527/";
+					if (newURLPrefix != null)
+					{
+						updateURLProperties(p,newURLPrefix);
+						p.setProperty("ij.user","APP");
+						p.setProperty("ij.password","PWD");
+					}
 			}
 			System.setProperties(p);
 		}

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java&r1=125446&p2=incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java	Mon Jan 17 14:23:26 2005
@@ -41,6 +41,7 @@
 
 import java.util.Properties;
 import java.util.Vector;
+import java.util.Locale;
 
 /**
 	Methods used to control setup for apps as
@@ -449,14 +450,12 @@
 
 	public static Properties updateConnInfo(String user, String password, Properties connInfo)
 	{
-		String framework = util.getSystemProperty("framework");
 		String ijGetMessages = util.getSystemProperty("ij.retrieveMessagesFromServerOnGetMessage");
 		boolean retrieveMessages = false;
 		
 		
 		// For JCC make sure we set it to retrieve messages
-		if (framework != null  && ((framework.equals("DB2jNet") 
-									|| framework.equals("DB2jcc"))))
+		if (isNetFramework())
 			retrieveMessages = true;
 		
 		if (ijGetMessages != null)
@@ -700,6 +699,8 @@
 	private static final String[][] protocolDrivers =
 		{
 		  { "jdbc:derby:net:",			"com.ibm.db2.jcc.DB2Driver"},
+		  { "jdbc:derby://",            "org.apache.derby.jdbc.ClientDriver"},
+
 		  { "jdbc:derby:",				"org.apache.derby.jdbc.EmbeddedDriver" },
 		};
 
@@ -736,4 +737,24 @@
 	public static void loadDriver(String driverClass) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
         Class.forName(driverClass).newInstance();
 	}
+
+	/**
+	 * Used to determine if this is a network testing framework 
+	 * So that retrieveMessages can be sent.  The plan is to have  
+	 * ij will retrieve messages by default and not look at the testing 
+	 * frameworks. So, ulitmately  this function will look at the driver
+	 * rather than the framework.
+	 * 
+	 * @ return true if the framework contains Net or JCC.
+	 */
+	private static boolean isNetFramework()
+	{
+		String framework = util.getSystemProperty("framework");
+		return ((framework != null)  &&
+			((framework.toUpperCase(Locale.ENGLISH).indexOf("NET") != -1) ||
+			 (framework.toUpperCase(Locale.ENGLISH).indexOf("JCC") != -1)));
+	}
+	
+
 }
+

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java&r1=125446&p2=incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/tools/URLCheck.java	Mon Jan 17 14:23:26 2005
@@ -97,7 +97,8 @@
 		
 		String protocol = "";
 
-        if( url.startsWith( "jdbc:derby:net:"))
+        if( url.startsWith( "jdbc:derby:net:") ||
+			url.startsWith( "jdbc:derby://"))
 		{
             validProps = null;
 		}

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java?view=diff&rev=125447&p1=incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java&r1=125446&p2=incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java&r2=125447
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java	Mon Jan 17 14:23:26 2005
@@ -311,6 +311,8 @@
 		if (derbyDriver == null) {
 			if (sourceDBUrl.indexOf(":net://") != -1)
 				derbyDriver = "com.ibm.db2.jcc.DB2Driver";
+			else if (sourceDBUrl.startsWith("jdbc:derby://"))
+			   derbyDriver = "org.apache.derby.jdbc.ClientDriver";
 			else
 				derbyDriver = "org.apache.derby.jdbc.EmbeddedDriver";
 	    }
@@ -352,7 +354,7 @@
 		// will be thrown when we try to connect).
 			return "";
 
-		start = dbUrl.indexOf("net://");
+		start = dbUrl.indexOf("://");
 		if (start == -1)
 		// standard url (jdbc:derby:<dbname>).  Database
 		// name starts right after "derby:".  The "6" in
@@ -361,9 +363,9 @@
 		else
 		// Network Server url.  Database name starts right
 		// after next slash (":net://hostname:port/<dbname>).
-		// The "6" in the following line is the length of
-		// "net://".
-			start = dbUrl.indexOf("/", start+6) + 1;
+		// The "3" in the following line is the length of
+		// "://".
+			start = dbUrl.indexOf("/", start+3) + 1;
 
 		int stop = -1;
 		if (dbUrl.charAt(start) == '"') {
@@ -506,7 +508,6 @@
 
 		try
 		{
-
 			// Connect to the database, prepare statements,
 			// and load id-to-name mappings.
 			this.conn = DriverManager.getConnection(sourceDBUrl);