Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC - JSP help required.

 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I 've developed a JSP that accesses Oracle database. I get an error stating "oracle.jdbc.driver.OracleDriver" not found.
Here are the statements...
<%@ page import="java.io.*, javax.servlet.jsp.*, java.sql.*" %>
<%@ page import="java.net.*, javax.servlet.jsp.*, javax.servlet.* " %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="oracle.jdbc.driver.*" %>
<h4>Metrics Report Generation System</h4>
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
//DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() );
Connection con;
// con=DriverManager.getConnection("jdbc racle ci8:@", "userID", "PSWD");
con=DriverManager.getConnection("jdbc racle:thin:@st052:1521:ORCL", "userID", "PSWD");
I am using Javawebserver2.0 just for Testing this application.
The classpaths have SERVLET.jar and JSP.jar.
I even tried to create a jar file containing the oracle driver classes and concatenated to the above mentioned class path but I still get the same error.
Can anybody help in solving this problem.
Thanks in advance,
Suresh Selvaraj
 
Bhupinder Dhillon
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your driver zip file in the <server-root>/lib directory and restart the server.
 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhupinder,
Thanks for your reply. Your suggestion was helpful and I was able to access the oracle database thru. JSP/JDBC
Thanks,
Suresh Selvaraj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic