You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Raj Subramani (JIRA)" <de...@db.apache.org> on 2004/12/07 18:07:10 UTC

[jira] Created: (DERBY-93) Cannot connect to Derby using DB2 Universal Driver

Cannot connect to Derby using DB2 Universal Driver
--------------------------------------------------

         Key: DERBY-93
         URL: http://nagoya.apache.org/jira/browse/DERBY-93
     Project: Derby
        Type: Bug
  Components: JDBC  
    Versions: 10.0.2.1    
 Environment: JDK 1.4.2.x
    Reporter: Raj Subramani
    Priority: Minor


As per the Server & Admi guide, the Derby network server should be accesible using the DB2 Universal Driver.
namely,
db2jcc.jar
db2jcc_license_c.jar

I have a (licensed) copy of the above driver which which I am able to connect to Cloudscape-DB2 v5.1.2.

Howver using the same driver jars I am unable to connect to Derby, the trace as follows:

java.sql.SQLException: No suitable driver
	at java.sql.DriverManager.getConnection(DriverManager.java:532)
	at java.sql.DriverManager.getConnection(DriverManager.java:171)
	at db.connection.TestConnection.setUp(TestConnection.java:34)
	at junit.framework.TestCase.runBare(TestCase.java:125)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)



My connectivity properties are:

db.driver=com.ibm.db2.jcc.DB2Driver
db.url=jdbc:derby:net://localhost/<db name>:bootPassword=<password>
db.user=demo
db.password=demo

The Derby database was created using ij and is an encrypted database. I am able to connect to Derby with the embedded driver

db.driver=db.driver=org.apache.derby.jdbc.EmbeddedDriver
db.url=jdbc:derby:H:/rl-hibernate/db/derby_10_0_2_1/<db name>;bootPassword=<password>
db.user=demo
db.password=demo


NOTE: The use of the ";" for bootPassword in embedded mode and the use of ":" in the network mode. This is as per the docs (and I have even tried using ";" for the networked mode but it will still not connect).


I then went and downloaded Clodscape 10 and used
db2jcc.jar
db2jcc_license_c.jar
from this distribution.

When I used the ":" syntax for the bootpassword, as per the docs I got:

com.ibm.db2.jcc.c.SqlException: Invalid database url syntax: jdbc:derby:net://localhost/<db name>:bootPassword=<password>
	at com.ibm.db2.jcc.DB2Driver.tokenizeURLProperties(DB2Driver.java:555)
	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:131)
	at java.sql.DriverManager.getConnection(DriverManager.java:512)
	at java.sql.DriverManager.getConnection(DriverManager.java:171)
	at db.connection.TestConnection.setUp(TestConnection.java:34)
	at junit.framework.TestCase.runBare(TestCase.java:125)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)


However, using a ";" before bootPassword=... 

results in a SUCCESSFUL connection.


I think it might be useful to state that it will work only with Cloudscape 10.0 (or above) IBM Universal drivers.

Also given that this licensed driver may expire after some time (as per the IBM license file), it makes it diffult to use this over a longer term. Will there be a AF licensed network driver for Derby?




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [jira] Created: (DERBY-93) Cannot connect to Derby using DB2 Universal Driver

Posted by Army <ar...@golux.com>.
Raj Subramani (JIRA) wrote:
> Cannot connect to Derby using DB2 Universal Driver
> --------------------------------------------------
[ snip ]
> As per the Server & Admi guide, the Derby network server should be accesible using the DB2 Universal Driver.
> namely, db2jcc.jar db2jcc_license_c.jar
> 
> I have a (licensed) copy of the above driver which which I am able to connect to Cloudscape-DB2 v5.1.2.
> 
> Howver using the same driver jars I am unable to connect to Derby
[ snip ]

Hi Raj,

Can you run the Derby "sysinfo" utility and see what version of the DB2 Universal Driver you have?  If your path is 
setup correctly, you should see something like this in the output:

 > java org.apache.derby.tools.sysinfo

[ snip ]
--------- Derby Information --------
[C:\p4clients\main_army\drda\jcc\2.4\db2jcc.jar] 2.4 - (17)
[C:\p4clients\main_army\drda\jcc\2.4\db2jcc_license_c.jar] 2.4 - (17)
------------------------------------------------------
[ snip ]

If the version of the db2jcc files that you're using is earlier than "2.4", then that's the problem.  JCC versions prior 
to 2.4 only recognize the name "cloudscape", not "derby"--which is why it works when you connect to a Cloudscape v5.1.2 
database, but not when you try to connect to a Derby database.

 > I then went and downloaded Clodscape 10 and used db2jcc.jar db2jcc_license_c.jar
 > from this distribution.

My guess is that the JCC jars that came with your download for Cloudscape 10 were for "Cloudscape", not "Derby".  On the 
Apache website, there is a link to a paper on the Universal Driver here:

http://incubator.apache.org/derby/papers/misc.html

Near the bottom, there's a link for "IBM DB2 JDBC Universal Driver", and if you follow that link, you can find out where 
to download a later version of the Universal Driver--and one that will work with Derby.

Which makes one wonder -- DOCUMENTATION ISSUE?  Should we document the fact that JCC 2.4 is the minimum required to user 
the Universal Driver for a Derby database?  Or is that documented somewhere already?

Hope that helps,
Army

Re: [jira] Created: (DERBY-93) Cannot connect to Derby using DB2 Universal Driver

Posted by Army <ar...@golux.com>.
Raj Subramani (JIRA) wrote:

> I then went and downloaded Clodscape 10 and used
> db2jcc.jar
> db2jcc_license_c.jar
> from this distribution.
> [ snip ]
> results in a SUCCESSFUL connection.
[ snip ]
 > I think it might be useful to state that it will work only with Cloudscape 10.0 (or above) IBM Universal drivers.

Ooops, in re-reading your post, I see you already figured out what I wrote--sorry for the unnecessary reply.

Army

[jira] Closed: (DERBY-93) Cannot connect to Derby using DB2 Universal Driver

Posted by "Samuel Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-93?page=all ]
     
Samuel Andrew McIntyre closed DERBY-93:
---------------------------------------


Duplicate of DERBY-92

> Cannot connect to Derby using DB2 Universal Driver
> --------------------------------------------------
>
>          Key: DERBY-93
>          URL: http://issues.apache.org/jira/browse/DERBY-93
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions: 10.0.2.1
>  Environment: JDK 1.4.2.x
>     Reporter: Raj Subramani
>     Priority: Minor

>
> As per the Server & Admi guide, the Derby network server should be accesible using the DB2 Universal Driver.
> namely,
> db2jcc.jar
> db2jcc_license_c.jar
> I have a (licensed) copy of the above driver which which I am able to connect to Cloudscape-DB2 v5.1.2.
> Howver using the same driver jars I am unable to connect to Derby, the trace as follows:
> java.sql.SQLException: No suitable driver
> 	at java.sql.DriverManager.getConnection(DriverManager.java:532)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:171)
> 	at db.connection.TestConnection.setUp(TestConnection.java:34)
> 	at junit.framework.TestCase.runBare(TestCase.java:125)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> My connectivity properties are:
> db.driver=com.ibm.db2.jcc.DB2Driver
> db.url=jdbc:derby:net://localhost/<db name>:bootPassword=<password>
> db.user=demo
> db.password=demo
> The Derby database was created using ij and is an encrypted database. I am able to connect to Derby with the embedded driver
> db.driver=db.driver=org.apache.derby.jdbc.EmbeddedDriver
> db.url=jdbc:derby:H:/rl-hibernate/db/derby_10_0_2_1/<db name>;bootPassword=<password>
> db.user=demo
> db.password=demo
> NOTE: The use of the ";" for bootPassword in embedded mode and the use of ":" in the network mode. This is as per the docs (and I have even tried using ";" for the networked mode but it will still not connect).
> I then went and downloaded Clodscape 10 and used
> db2jcc.jar
> db2jcc_license_c.jar
> from this distribution.
> When I used the ":" syntax for the bootpassword, as per the docs I got:
> com.ibm.db2.jcc.c.SqlException: Invalid database url syntax: jdbc:derby:net://localhost/<db name>:bootPassword=<password>
> 	at com.ibm.db2.jcc.DB2Driver.tokenizeURLProperties(DB2Driver.java:555)
> 	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:131)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:512)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:171)
> 	at db.connection.TestConnection.setUp(TestConnection.java:34)
> 	at junit.framework.TestCase.runBare(TestCase.java:125)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> However, using a ";" before bootPassword=... 
> results in a SUCCESSFUL connection.
> I think it might be useful to state that it will work only with Cloudscape 10.0 (or above) IBM Universal drivers.
> Also given that this licensed driver may expire after some time (as per the IBM license file), it makes it diffult to use this over a longer term. Will there be a AF licensed network driver for Derby?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-93) Cannot connect to Derby using DB2 Universal Driver

Posted by "Samuel Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-93?page=all ]
     
Samuel Andrew McIntyre resolved DERBY-93:
-----------------------------------------

    Resolution: Duplicate

Duplicate of DERBY-92

> Cannot connect to Derby using DB2 Universal Driver
> --------------------------------------------------
>
>          Key: DERBY-93
>          URL: http://issues.apache.org/jira/browse/DERBY-93
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions: 10.0.2.1
>  Environment: JDK 1.4.2.x
>     Reporter: Raj Subramani
>     Priority: Minor

>
> As per the Server & Admi guide, the Derby network server should be accesible using the DB2 Universal Driver.
> namely,
> db2jcc.jar
> db2jcc_license_c.jar
> I have a (licensed) copy of the above driver which which I am able to connect to Cloudscape-DB2 v5.1.2.
> Howver using the same driver jars I am unable to connect to Derby, the trace as follows:
> java.sql.SQLException: No suitable driver
> 	at java.sql.DriverManager.getConnection(DriverManager.java:532)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:171)
> 	at db.connection.TestConnection.setUp(TestConnection.java:34)
> 	at junit.framework.TestCase.runBare(TestCase.java:125)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> My connectivity properties are:
> db.driver=com.ibm.db2.jcc.DB2Driver
> db.url=jdbc:derby:net://localhost/<db name>:bootPassword=<password>
> db.user=demo
> db.password=demo
> The Derby database was created using ij and is an encrypted database. I am able to connect to Derby with the embedded driver
> db.driver=db.driver=org.apache.derby.jdbc.EmbeddedDriver
> db.url=jdbc:derby:H:/rl-hibernate/db/derby_10_0_2_1/<db name>;bootPassword=<password>
> db.user=demo
> db.password=demo
> NOTE: The use of the ";" for bootPassword in embedded mode and the use of ":" in the network mode. This is as per the docs (and I have even tried using ";" for the networked mode but it will still not connect).
> I then went and downloaded Clodscape 10 and used
> db2jcc.jar
> db2jcc_license_c.jar
> from this distribution.
> When I used the ":" syntax for the bootpassword, as per the docs I got:
> com.ibm.db2.jcc.c.SqlException: Invalid database url syntax: jdbc:derby:net://localhost/<db name>:bootPassword=<password>
> 	at com.ibm.db2.jcc.DB2Driver.tokenizeURLProperties(DB2Driver.java:555)
> 	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:131)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:512)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:171)
> 	at db.connection.TestConnection.setUp(TestConnection.java:34)
> 	at junit.framework.TestCase.runBare(TestCase.java:125)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> However, using a ";" before bootPassword=... 
> results in a SUCCESSFUL connection.
> I think it might be useful to state that it will work only with Cloudscape 10.0 (or above) IBM Universal drivers.
> Also given that this licensed driver may expire after some time (as per the IBM license file), it makes it diffult to use this over a longer term. Will there be a AF licensed network driver for Derby?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira