db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r151217 - in incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij: ij.jj util.java
Date Thu, 03 Feb 2005 20:04:04 GMT
Author: djd
Date: Thu Feb  3 12:04:03 2005
New Revision: 151217

URL: http://svn.apache.org/viewcvs?view=rev&rev=151217
Log:
Remove some uses of java.sql.Driver/DriverManager from ij for J2ME work.

Modified:
    incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
    incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj?view=diff&r1=151216&r2=151217
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj (original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj Thu Feb  3
12:04:03 2005
@@ -32,7 +32,6 @@
 
 import java.lang.reflect.*;
 import java.sql.Connection;
-import java.sql.Driver;
 import java.sql.DriverManager;
 import java.sql.Statement;
 import java.sql.PreparedStatement;
@@ -119,7 +118,7 @@
 		protocol = p.getProperty(PROTOCOL_PROPERTY);
 		String framework_property = p.getProperty(FRAMEWORK_PROPERTY);
 		
-		if ((JVMInfo.JDK_ID >= 2) && ij.JDBC20X() && ij.JTA() && ij.JNDI())
+		if (ij.JDBC20X() && ij.JTA() && ij.JNDI())
 		{
 			try {
 				xahelper = (xaAbstractHelper) Class.forName("org.apache.derby.impl.tools.ij.xaHelper").newInstance();
@@ -1161,7 +1160,6 @@
 
 		// add protocol if no driver matches url
 		boolean noDriver = false;
-		try {
 			// if we have a full URL, make sure it's loaded first
 			try {
 				if (sVal.startsWith("jdbc:"))
@@ -1174,11 +1172,7 @@
                         if (System.getProperty("ij.URLCheck") == null || Boolean.getBoolean("ij.URLCheck"))
{
                           URLCheck aCheck = new URLCheck(sVal);
                         }
-			Driver driver = DriverManager.getDriver(sVal);
-		} catch (SQLException se) {
-			noDriver = true;
-		}
-		if (noDriver && (p == null) && (protocol != null)) {
+		if (!sVal.startsWith("jdbc:") && (p == null) && (protocol != null)) {
 			sVal = protocol + sVal;
 		}
 

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&r1=151216&r2=151217
==============================================================================
--- 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 Thu Feb
 3 12:04:03 2005
@@ -389,16 +389,10 @@
 	if (databaseURL == null || databaseURL.length()==0) databaseURL = defaultURL;
 	if (databaseURL != null) {
 	    // add protocol if might help find driver.
-	    boolean noDriver = false;
-	    try {
 		// if have full URL, load driver for it
 		if (databaseURL.startsWith("jdbc:"))
 		    util.loadDriverIfKnown(databaseURL);
-		DriverManager.getDriver(databaseURL);
-	    } catch (SQLException se) {
-		noDriver = true;
-	    }
-	    if (noDriver && jdbcProtocol != null)
+	    if (!databaseURL.startsWith("jdbc:") && jdbcProtocol != null)
 		databaseURL = jdbcProtocol+databaseURL;
 
 	    String user = util.getSystemProperty("ij.user");



Mime
View raw message