jsp连接Oracle数据库错误,急!
代码如下:<%@pagecontentType="text/htm;charset=gb2312"%><%@pageimport="java.sql.*"%><%Clas...
代码如下:
<%@ page contentType="text/htm;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:bbs";
String user="scott";
String password="tiger";
Connection conn= DriverManager.getConnection(url,user,password);
Statement
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
%>
报错:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /conn.jsp at line 5
2:
3: <%@ page import="java.sql.*"%>
4:
5: <%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
6: String url="jdbc:oracle:thin:@localhost:1521:bbs";
7: String user="scott";
8: String password="tiger";
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
一楼不对
oot cause
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
这是怎么回事啊
三楼localhost就是本地ip 展开
<%@ page contentType="text/htm;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:bbs";
String user="scott";
String password="tiger";
Connection conn= DriverManager.getConnection(url,user,password);
Statement
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
%>
报错:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /conn.jsp at line 5
2:
3: <%@ page import="java.sql.*"%>
4:
5: <%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
6: String url="jdbc:oracle:thin:@localhost:1521:bbs";
7: String user="scott";
8: String password="tiger";
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
一楼不对
oot cause
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
这是怎么回事啊
三楼localhost就是本地ip 展开
展开全部
<%@page import="java.util.*,java.sql.*,"%>
String url="jdbc:oracle:thin:@127.0.0.1:1521:bbs";
String url="jdbc:oracle:thin:@127.0.0.1:1521:bbs";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
String url="jdbc:oracle:thin:@你的IP:oracle实际端口:bbs";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询