This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Derby Embedded Driver ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Derby Embedded Driver ClassNotFoundException" Watch "Derby Embedded Driver ClassNotFoundException" New topic

Derby Embedded Driver ClassNotFoundException

baris bakla

Joined: Dec 20, 2010
Posts: 3
My main problem is I have a class,, that access and updates the JDBC Derby database. Using unit test class, passes but using a servlet it throws exception. What can be the reason?
Below the codes are available.
I have a program which is

I wrote a unit test for class DatabaseTest which successfully tests and verifies the Database class

But when call the Database instance from the servlet Voter, it gives the ClassNotFoundException

The code of the servlet

Wendy Gibbons

Joined: Oct 21, 2008
Posts: 1107

Welcome to the ranch Baris (is Baris your first name?)
here is a very useful (hopefully) link to one of our in house FAQs
baris bakla

Joined: Dec 20, 2010
Posts: 3
yes, it is my first name.

baris bakla

Joined: Dec 20, 2010
Posts: 3
Well, derby.jar should be available in /WEB-INF/lib
It is sorta covered in the JavaRanch Style Guide.
subject: Derby Embedded Driver ClassNotFoundException
It's not a secret anymore!