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 bp...@apache.org on 2006/08/16 01:48:22 UTC

svn commit: r431741 - in /db/derby/code/trunk/java: testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out tools/org/apache/derby/impl/tools/sysinfo/Main.java

Author: bpendleton
Date: Tue Aug 15 16:48:22 2006
New Revision: 431741

URL: http://svn.apache.org/viewvc?rev=431741&view=rev
Log:
DERBY-415 : sysinfo with -cp client should not complain about DB2 Driver

This change modifies the behavior of the "-cp client" argument to the
sysinfo tool. Formerly, this argument checked for both the DerbyNetClient
and the DB2 JCC driver, and complained if both drivers were not present.

Increasingly, users of Derby are using just the DerbyNetClient, and the use
of the JCC driver is less common, so it makes sense that "-cp client" should
focus on the DerbyNetClient, and the DB2 JCC driver can be treated separately.

So, "-cp client" now only checks for the DerbyNetClient, and a new argument
"-cp db2driver" is added to check for the DB2 JCC driver. The new behavior is:
   java sysinfo -cp: checks all the various components of the classpath
   java sysinfo -cp client: just checks the network client
   java sysinfo -cp db2driver: just checks the JCC driver


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out?rev=431741&r1=431740&r2=431741&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out Tue Aug 15 16:48:22 2006
@@ -1,7 +1,7 @@
 ij --help:
 Usage: java org.apache.derby.tools.ij [-p propertyfile] [-ca connectionAttributePropertyFile] [inputfile]
 sysinfo -cp help:
-USAGE: java org.apache.derby.tools.sysinfo -cp [ [ embedded ][ server ][ client] [ tools ] [  anyClass.class ] ]
+USAGE: java org.apache.derby.tools.sysinfo -cp [ [ embedded ][ server ][ client] [ db2driver ] [ tools ] [  anyClass.class ] ]
 dblook:
  USAGE:
  java org.apache.derby.tools.dblook -d <sourceDBUrl> [OPTIONS]

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=431741&r1=431740&r2=431741&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Tue Aug 15 16:48:22 2006
@@ -454,12 +454,13 @@
 
 	private static final String NET = "server";
 	private static final String CLIENT = "client";
+	private static final String DB2DRIVER = "db2driver";
 
 	/* you can add this if you like */
 
 	private static final String MAINUSAGESTRING = "java org.apache.derby.tools.sysinfo -cp";
 
-	private static final String USAGESTRINGPARTA = MAINUSAGESTRING + " [ [ " + EMBEDDED + " ][ " + NET + " ][ " + CLIENT + "] [ " + TOOLS + " ] [ ";
+	private static final String USAGESTRINGPARTA = MAINUSAGESTRING + " [ [ " + EMBEDDED + " ][ " + NET + " ][ " + CLIENT + "] [ " + DB2DRIVER + " ] [ " + TOOLS + " ] [ ";
     private static final String USAGESTRINGPARTB = ".class ] ]";
 
   static  void useMe(String[] args, java.io.PrintWriter pw) {
@@ -507,6 +508,7 @@
 		  tryCoreClasspath(successes, failures);
 		  tryNetClasspath(successes, failures);
 		  tryClientClasspath(successes, failures);
+		  tryDB2DriverClasspath(successes, failures);
 		  tryUtilsClasspath(successes, failures);
 		  localPW.println(successes.toString());
 		  if (!failures.toString().equals(crLf() + Main.getTextMessage("SIF08.E") + crLf())) {
@@ -542,6 +544,10 @@
 			seenArg =true;
 
 		}
+		if (argumentsContain(args,DB2DRIVER)) {
+			tryDB2DriverClasspath(successes, failures);
+			seenArg =true;
+		}
 
 		if (argumentsContain(args,TOOLS) || argumentsContain(args,"utils")) {
 		  tryUtilsClasspath(successes, failures);
@@ -584,9 +590,15 @@
 		tryMyClasspath("org.apache.derby.drda.NetworkServerControl", Main.getTextMessage("SIF08.I", "derbynet.jar"), successes, failures);
 	}
 	private static void tryClientClasspath(StringBuffer successes, StringBuffer failures) {
-		tryMyClasspath("com.ibm.db2.jcc.DB2Driver", Main.getTextMessage("SIF08.L", "db2jcc.jar"), successes, failures);
 		tryMyClasspath("org.apache.derby.jdbc.ClientDriver", Main.getTextMessage("SIF08.L", "derbyclient.jar"), successes, failures);
 	}
+    private static void tryDB2DriverClasspath(StringBuffer successes,
+            StringBuffer failures)
+    {
+        tryMyClasspath("com.ibm.db2.jcc.DB2Driver",
+                Main.getTextMessage("SIF08.L", "db2jcc.jar"),
+                successes, failures);
+    }
 
 	private static void tryUtilsClasspath(StringBuffer successes, StringBuffer failures) {
 		tryMyClasspath("org.apache.derby.tools.ij", Main.getTextMessage("SIF08.Q", "derbytools.jar"), successes, failures);