db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r263981 - in /db/derby/code/branches/10.1/java: engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/
Date Mon, 29 Aug 2005 01:10:54 GMT
Author: kmarsden
Date: Sun Aug 28 18:10:44 2005
New Revision: 263981

URL: http://svn.apache.org/viewcvs?rev=263981&view=rev
Log:
DERBY-535 Driver.acceptsURL() for embedded driver incorrectly returns true for
a client url like jdbc:derby://

Changed embedded driver to reject network URL's
Added test for testing driver methods. 


Added:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/checkDriver.out
  (props changed)
      - copied unchanged from r240352, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDriver.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
  (props changed)
      - copied unchanged from r240352, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_app.properties
  (props changed)
      - copied unchanged from r240368, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_app.properties
Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/reference/Attribute.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/jdbc/InternalDriver.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/reference/Attribute.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/reference/Attribute.java?rev=263981&r1=263980&r2=263981&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/reference/Attribute.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/reference/Attribute.java
Sun Aug 28 18:10:44 2005
@@ -44,7 +44,7 @@
 public interface Attribute {
 
 	/**
-		Not an attribute but the root for the JDBC URL that Cloudscape supports.
+		Not an attribute but the root for the JDBC URL that Derby supports.
 	*/
 	String PROTOCOL = "jdbc:derby:";
 		
@@ -54,7 +54,21 @@
 	 */
 	String SQLJ_NESTED = "jdbc:default:connection";
 
-
+	
+	// Network Protocols.  These need to be rejected by the embedded driver.
+	
+	/**
+	 * The protocol for Derby Network Client 
+	 */ 
+	String DNC_PROTOCOL = "jdbc:derby://";
+	
+	/** 
+	 * The protocol for the IBM Universal JDBC Driver 
+	 * 
+	 */
+	String JCC_PROTOCOL = "jdbc:derby:net:";
+	
+	
 	/**
 		Attribute name to encrypt the database on disk.
 		If set to true, all user data is stored encrypted on disk.

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/jdbc/InternalDriver.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/jdbc/InternalDriver.java?rev=263981&r1=263980&r2=263981&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/jdbc/InternalDriver.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/jdbc/InternalDriver.java Sun
Aug 28 18:10:44 2005
@@ -102,7 +102,11 @@
 	** Methods from java.sql.Driver
 	*/
 	public boolean acceptsURL(String url) {
-		return active && (url.startsWith(Attribute.PROTOCOL) || url.equals(Attribute.SQLJ_NESTED));
+		return active &&
+		//	need to reject network driver's URL's
+		!url.startsWith(Attribute.JCC_PROTOCOL) && !url.startsWith(Attribute.DNC_PROTOCOL)
&&
+		(url.startsWith(Attribute.PROTOCOL) || url.equals(Attribute.SQLJ_NESTED));
+				
 	}
 
 	public Connection connect(String url, Properties info)

Propchange: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/checkDriver.out
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant?rev=263981&r1=263980&r2=263981&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
Sun Aug 28 18:10:44 2005
@@ -6,6 +6,7 @@
 blobclob4BLOB_derby.properties
 bestrowidentifier.sql
 bestrowidentifier_app.properties
+checkDriver_app.properties
 dbMetaDataJdbc30_app.properties
 dbMetaDataJdbc30_sed.properties
 default_app.properties



Mime
View raw message