aspose file tools*
The moose likes JDBC and the fly likes Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can not load JDBC driver named Watch "Can not load JDBC driver named New topic
Author

Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver'

Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
Hello,

I'm French so I,m sorry if I make some mistakes.
I have created a database and I have generated classes thanks to Cayenne.
Driver used : org.apache.derby.jdbc.EmbeddedDriver
URL : jdbc:derby:database
I have created a "main" class to insert and delete some informations from the database (it's not a memory database). It works perfectly and this, from a remote client.

Now I want to connect more than one client on the database at the same time. So in CayenneModeler I change the driver and the URL :
Driver used : org.apache.derby.ClientDriver
URL : jdbc:derby://localhost/database
After' I launch the jetty server (port 8080) and the derby server (port 1527) from Eclipse. I run the main class in the client machine and I obtain an error :



If you need more informations, ask me.

Thanks
Tadrierion
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

Axel Sec wrote:Hello,

I'm French so I,m sorry if I make some mistakes.
I have created a database and I have generated classes thanks to Cayenne.
Driver used : org.apache.derby.jdbc.EmbeddedDriver
URL : jdbc:derby:database
I have created a "main" class to insert and delete some informations from the database (it's not a memory database). It works perfectly and this, from a remote client.

Now I want to connect more than one client on the database at the same time. So in CayenneModeler I change the driver and the URL :
Driver used : org.apache.derby.ClientDriver
URL : jdbc:derby://localhost/database
After' I launch the jetty server (port 8080) and the derby server (port 1527) from Eclipse. I run the main class in the client machine and I obtain an error :

If you need more informations, ask me.

Thanks
Tadrierion


Unless things have changed, you can only have 1 connection to a derby database at a time.
Are you sure the derby jar is in your classpath?
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
In Eclipse yes :



And in CayenneModeler too.

I have changed my driver (without cayenne, for instance with RazorSQL, I can connect more than one user).

Thanks for your answer
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

you can have lots of applications using the same database, but not actually connecting at the same time. There is this good page i found
http://docs.oracle.com/javadb/10.3.3.0/devguide/rdevconcepts713.html.

It looks like your classpath is good, have you checked inside the library to ensure the class you are after is in there?

other than that we will need some code to try and help anymore
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
Where can I verify my library ?

Do you need the main code ? Or another ?

PS : I have already used Derby with Eclipse but never with Cayenne at the same time.

Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
In your link, I would like to do the third solution : multi-users.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

was that the 3rd option that said "can't do" sorry I can't load the page anymore, i get the following error:

File not found

Firefox can't find the file at http://docs.oracle.com/javadb/10.3.3.0/devguide/rdevconcepts713.html.
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11


I don't know why I can't.

I don't want to use the Embedded Driver (only one user)
I want to do a connection client/server.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

because that is just how derby is written, you will have to choose another database, if that is a requirement.
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
"Only one server should access a database at a time. Multiple remote client applications can access the same server, and thus can access the same database at the same time through that server."

It says that I can create multiple users if my database is on a server.

(I do my internship, so I can't choose another database, if it's really not possible, I will say it to my tutor :p)
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

How will the clients be communicating with the server?

ahh sorry now i understand, so you will have 1 server application running connecting to the database.
and many client applications connecting to the 1 server.

Do you understand what i mean?
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
Yes it's exactly that

One database on the server and many many clients connect on it :p
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

so...., why won't it load the driver, with the cayenne where is the actual load happening, is it in a different project?
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
One project on the server, with all generated classes (CayenneModeler). One Database on the server.

One project on the client with all generated classes and one main class which connect to the server.

I launch two servers : Jetty Server and Derby Server.
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
Nobody has an idea ?
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
I tried to do the same things but on the same computer, and I have the same error.

I tried to enter an unknown driver and I have the same error.

I verify in the library if the driver is here :
Axel Sec
Greenhorn

Joined: Apr 26, 2012
Posts: 11
Solution : Add derbyclient.jar in "Maven Dependencies".
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

ahh, sorry we weren't able to help, but thanks for letting us know the answer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver'
 
Similar Threads
Question on JForums Database space
NullPointerException
Error during install
The First Steps.. you start here
Convert phpbb/mysql to jforum/hsqldb