*
The moose likes JDBC and the fly likes database conn. jsp tomcat Oracle9i thin driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "database conn. jsp tomcat Oracle9i thin driver" Watch "database conn. jsp tomcat Oracle9i thin driver" New topic
Author

database conn. jsp tomcat Oracle9i thin driver

Vikramjit Singh
Greenhorn

Joined: Sep 01, 2005
Posts: 15
hi,

Am trying to make database connection using Oracle9i thin driver, what am doing is:
I put classes12.zip and classes12_dms.jar in the classpath and also added these libraries in netbeans library folder.

I make jsp page like this --------

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*, java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing Page</title>
</head>
<body>
<%
String url = "jdbc racle:thin:@SERVERNAME:1521 BNAME";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(url,"scott","tiger");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from person order by name");
%>
<h1>Testing Page</h1><hr>
<table border="1">
<tbody>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
<% while(rs.next()) {%>
<tr>
<td><%= rs.getString(1)%></td>
<td><%= rs.getString(2)%></td>
</tr>
<%
}
rs.close();
stmt.close();
conn.close();
} catch(ClassNotFoundException CNFEx) {
out.println("<b>Error !</b><br>" + CNFEx.getMessage());
} catch(Exception Ex) {
out.println("<b>Error !</b><br>" + Ex.getMessage());
}
%>
</tbody>
</table>
</body>
</html>

when I run this page i got this error messages ----

type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:138)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

root cause
java.lang.NoClassDefFoundError
oracle.jdbc.driver.OracleConnection.createDMSSensors(OracleConnection.java:506)
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:330)
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:485)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

any kind of help is appericiable.
thanks.....
 
Consider Paul's rocket mass heater.
 
subject: database conn. jsp tomcat Oracle9i thin driver
 
Similar Threads
Module 'null' not found
struts
Regarding EL
How to pass a session from a class to another class
Struts Logic Tag problem