You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Kostas Karadamoglou <ka...@yahoo.gr> on 2005/08/13 19:16:31 UTC

Re: Problems with Derby 10.1.1 and derbyclient.jar [SQLException: No suitable driver]

Hello Sunitha,

Yes I was using com.ibm.db2.jcc.DB2Driver. I did a mistake!

I have an database that was being operated by Derby 10.0. What I changed 
  was the derby.jar and derbynet.jar at the server and the 
derbyclient.jar at the client. However I kept the database url same. So 
I tried to use this 
"jdbc:derby:net://localhost:1527/sampleDb:user=u1;password=p1;" url 
scheme with the org.apache.derby.jdbc.ClientDriver driver.

I quess that is my mistake. Isn't it true?

thank you in advance, Kostas

Sunitha Kambhampati wrote:
> Kostas Karadamoglou wrote:
> 
>> Hi all,
>>
>> I was using Derby 10.0 with db2cc.jar and db2_licensecc.jar in network 
>> mode. The driver was called com.ibm.db2.jdbcDriver. Everything was 
>> working fine :)
>>
>> But now I changed to 10.1.1. The driver jar is derbyclient.jar and the 
>> driver org.apache.derby.jdbc.ClientDriver. Whenever I load the driver 
>> at the DriverManager and try to use getConnection I get the following 
>> exception:
>>
>> java.sql.SQLException: No suitable driver
>>         at java.sql.DriverManager.getConnection(DriverManager.java:545)
>>
>> Do you know how I can solve this problem?
>>
>> Thank you in advance, Kostas
>>
>>
> Actually the JCC driver is com.ibm.db2.jcc.DB2Driver.  Can you check 
> your connection url  again.
> 
> So when using the client driver , the connection url is of the form  
> jdbc:derby://</server/>[:</port/>]/ </databaseName/>[;<URL 
> attribute>=<value> [;...]]
> Ex , assuming server is running on localhost at port 1527. To connect 
> via client driver, the url would be    
> jdbc:derby://localhost:1527/sampleDb;user=u1;password=p1
> 
> To connect via JCC driver, the connection url would be
> jdbc:derby:net://localhost:1527/sampleDb:user=u1;password=p1;
> 
> 
> Hope this helps, if not please feel free to post again, and also include 
> the connection url you are using.
> 
> Sunitha.
> 
> 
> 


Re: Problems with Derby 10.1.1 and derbyclient.jar [SQLException: No suitable driver]

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Kostas Karadamoglou wrote:

> So I tried to use this 
> "jdbc:derby:net://localhost:1527/sampleDb:user=u1;password=p1;" url 
> scheme with the org.apache.derby.jdbc.ClientDriver driver.
> I quess that is my mistake. Isn't it true?

Hi Kostas,

Yes, You need to change the connection url if you want to use the Client 
driver.   So the correct connection url when using the client driver 
(org.apache.derby.jdbc.ClientDriver) will be 
"jdbc:derby://localhost:1527/sampleDb;user=u1;password=p1"

Also note, that support for Client driver has been added only in version 
10.1.

Here are some manual links that you may find helpful:
http://db.apache.org/derby/docs/10.1/adminguide/cadminappsclient.html
http://db.apache.org/derby/docs/10.1/adminguide/radminappsclientxmp.html   
( this has examples).

hope this helps,
Sunitha.

> thank you in advance, Kostas
>
> Sunitha Kambhampati wrote:
>
>> Kostas Karadamoglou wrote:
>>
>>> Hi all,
>>>
>>> I was using Derby 10.0 with db2cc.jar and db2_licensecc.jar in 
>>> network mode. The driver was called com.ibm.db2.jdbcDriver. 
>>> Everything was working fine :)
>>>
>>> But now I changed to 10.1.1. The driver jar is derbyclient.jar and 
>>> the driver org.apache.derby.jdbc.ClientDriver. Whenever I load the 
>>> driver at the DriverManager and try to use getConnection I get the 
>>> following exception:
>>>
>>> java.sql.SQLException: No suitable driver
>>>         at java.sql.DriverManager.getConnection(DriverManager.java:545)
>>>
>>> Do you know how I can solve this problem?
>>>
>>> Thank you in advance, Kostas
>>>
>>>
>> Actually the JCC driver is com.ibm.db2.jcc.DB2Driver.  Can you check 
>> your connection url  again.
>>
>> So when using the client driver , the connection url is of the form  
>> jdbc:derby://</server/>[:</port/>]/ </databaseName/>[;<URL 
>> attribute>=<value> [;...]]
>> Ex , assuming server is running on localhost at port 1527. To connect 
>> via client driver, the url would be    
>> jdbc:derby://localhost:1527/sampleDb;user=u1;password=p1
>>
>> To connect via JCC driver, the connection url would be
>> jdbc:derby:net://localhost:1527/sampleDb:user=u1;password=p1;
>>
>>
>> Hope this helps, if not please feel free to post again, and also 
>> include the connection url you are using.
>>
>> Sunitha.
>>
>>
>>
>
>