Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting jsp with derby

 
Raman Ghai
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 2495
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raman Ghai
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 2495
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic