aspose file tools*
The moose likes JSP and the fly likes Connecting jsp with derby Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Connecting jsp with derby" Watch "Connecting jsp with derby" New topic
Author

Connecting jsp with derby

Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51
Hello guys,
I have written a code to connect the DERBY database with a jsp. I am using Netbeans IDE 7.0.1


I get the following exception at runtime


I have created a connection pool and resource. Moreover I have included the following libraries in the project:
Glassfish Server 3.1
derby.jar
Jdk 1.7
jstl 1.1
Please help me resolve this..
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Where is the derby.jar file? It needs to be in a directory where whichever servlet container you're using can find it.
Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51
derby.jar file location : F:\Program Files\glassfish-3.1.1\javadb\lib\derby.jar
I have added this jar file manually to the libraries. However this has not helped me.
Additional info :
The xml file for the jdbc resource is as follows :
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

I hope that this is not in production code.

The use of a DB in the presentation layer is considered a poor practice, and even the framers of the JSTL Specification recommend using the JSTL SQL tags only in prototype code and never in production code.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51
Bear Bibeault wrote:I hope that this is not in production code.

This is not a production code. I have just started learning JSP.
I can easily connect with derby using a simple java class. however, I am not able to figure out the exact problem here using JSP.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I suspect that the directory where the derby.jar file resides is not part of the runtime classpath. I'm not familier with GlassFish, though.
Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51

Changed the Server to Apache TomCat
Instead of derby.jar, added derbyClient.jar file in the libraries
Now I can connect to Derby and display the table data
Thanks for replying Tim Moores
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting jsp with derby
 
Similar Threads
Jsp databse connectivity problem
JSTL Expression issue
JSTL SQL and MYSQL connection help.
java.sql.SQLException: No suitable driver found
Trouble in retrieving data from the mysql database using JSTL