db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r105887 - incubator/derby/code/trunk/java/tools/org/apache/derby/tools
Date Fri, 19 Nov 2004 22:05:59 GMT
Author: bandaram
Date: Fri Nov 19 14:05:58 2004
New Revision: 105887

Modified:
   incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java
Log:
Derby-59: Enable dblook to use a driver provided by the caller, instead of assuming JCC or
EmbeddedDriver

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java
==============================================================================
--- 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	Fri Nov 19 14:05:58
2004
@@ -297,28 +297,31 @@
 
 	/* ************************************************
 	 * loadDriver:
-	 * Load db2j driver.
+	 * Load derby driver.
 	 * @param precondition sourceDBUrl has been loaded.
 	 * @return false if anything goes wrong; true otherwise.
 	 ****/
 
 	private boolean loadDriver() {
 
-		String db2jDriver;
-		if (sourceDBUrl.indexOf(":net://") != -1)
-			db2jDriver = "com.ibm.db2.jcc.DB2Driver";
-		else
-			db2jDriver = "org.apache.derby.jdbc.EmbeddedDriver";
+		String derbyDriver = System.getProperty("driver");
+		if (derbyDriver == null) {
+			if (sourceDBUrl.indexOf(":net://") != -1)
+				derbyDriver = "com.ibm.db2.jcc.DB2Driver";
+			else
+				derbyDriver = "org.apache.derby.jdbc.EmbeddedDriver";
+	    }
+
 		try {
-			Class.forName(db2jDriver).newInstance();
-		} catch (Exception e)
+			Class.forName(derbyDriver).newInstance();
+	    }
+		catch (Exception e)
 		{
 			Logs.debug(e);
 			return false;
 		}
 
 		return true;
-
 	}
 
 	/* ************************************************

Mime
View raw message