IntelliJ Java IDE
The moose likes JSP and the fly likes Connecting jsp with derby Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Connecting jsp with derby" Watch "Connecting jsp with derby" New topic
Author

Connecting jsp with derby

Parminder Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 30
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: 2329
Where is the derby.jar file? It needs to be in a directory where whichever servlet container you're using can find it.
Parminder Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 30
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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Parminder Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 30
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: 2329
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.
Parminder Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 30

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
 
 
subject: Connecting jsp with derby
 
Threads others viewed
JSTL Expression issue
java.sql.SQLException: No suitable driver found
Trouble in retrieving data from the mysql database using JSTL
Jsp databse connectivity problem
JSTL SQL and MYSQL connection help.
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com