tomcat连接oracle9问题
代码
<%@page contentType= "text/html;charset=gb2312 " language= "java " import= "java.sql.* "%>
<%@page import= "java.io.* "%>
<%@page import= "java.lang.* "%>
<html>
<body>
以下是从Oracle数据库读取的数据: <hr>
<table border=1>
<tr> <td> id </td> <td> 书名 </td> <td> 出版社 </td> <td> 价格 </td> </tr>
<%
Class.forName( "oracle.jdbc.driver.OracleDriver ").newInstance();
String url= "jdbc.oracle:thin:@localhost:1521:oracle ";
String uid= "system ";
String pwd= "system ";
Connection con=DriverManager.getConnection(url,uid,pwd);
out.println(DriverManager.getConnection(url,uid,pwd));
Statement stmt=con.createStatement();
ResultSet rst=stmt.executeQuery( "select * from system.book ");
while(rst.next()){
out.println( " <tr> ");
out.println( " <td> "+rst.getString( "BOOKID ")+ " </td> ");
}
rst.close();
stmt.close();
con.close();
%>
</table>
</body>
</html>
错误:
javax.servlet.ServletException: No suitable driver
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Oracle_jsp._jspService(Oracle_jsp.java:93)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServl