This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSP and the fly likes Accessing database through JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Accessing database through JSP" Watch "Accessing database through JSP" New topic

Accessing database through JSP

RaviSingh Kumar
Ranch Hand

Joined: Sep 04, 2007
Posts: 52

I had written java program to establish a connection to the database(Oracle 10g) and using it through Swing application.But getting problem with JSP.
I just want to know that how the above java file is used through JSP.
I had already copied the classes12.jar file to ext\lib folder under java directory and also under tomcat dir.

Please help in this regards

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
But getting problem with JSP

What does this mean? If there is an error message, tell us what it is.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

I had already copied the classes12.jar file to ext\lib folder under java directory and also under tomcat dir.

Putting in in the Java and/or Tomcat directory will not help.
It needs to be in a specific place within either the tomcat directory structure or within your application. Which depends on how you are trying to connect to the database.

Show us your code for connecting to the database and we can point you in the right direction.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
kelby zorgdrager

Joined: Feb 05, 2008
Posts: 12
i am assuming you get a ClassNotFoundException? if so, the lib\ext should work. remember if you are on windows, there is a jre\lib\ext where the jre is installed and there is another one where the JDK is installed. make sure your JAVA_HOME is set in the catalina.bat to point to the *correct* lib\ext.

<a href="" target="_blank" rel="nofollow">J2EE Training / Java EE Training ... Learn Java EE </a>
I agree. Here's the link:
subject: Accessing database through JSP
It's not a secret anymore!