我用MyEclipse连接数据库时提示了这样的错误,不知道为什么。
The server encountered an internal error () that prevented it from fulfilling this request.
exception org.apache.jasper.JasperException: Exception in JSP: /WebRoot/JDBC.jsp:5
2: <%@ page import="java.sql.*" %>
3: <%
4:
5: Class.forName("oracle.jdbc.driver.OracleDriver");
6: Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","admin");
7: Statement sm= conn.createStatement();
8: ResultSet rs = sm.executeQuery("select * from dept");
提示是第五行出错?连接的数据库名称也没错啊。但是我数据库也确实连接上了:
服务器遇到内部错误( )表示,无法履行这项要求。
org.apache.jasper.jasperexception :无法编译类的JSP :
发生错误行: 3月在JSP的文件: /网页/ specificnews - change.jsp
mm_connlzs_driver解决不了的
1 : < % @页的ContentType =的“ text / html ;字符集= gb2312 ”语文= “ Java的”进口= “ java.sql .* ”进口= “ java.sql.drivermanager ” % >
2 : < %
3 :司机driverrenew = (司机) class.forname ( mm_connlzs_driver ) 。 newinstance ( ) ;
4 :连接connrenew = drivermanager.getconnection ( mm_connlzs_string , mm_connlzs_username , mm_connlzs_password ) ;
5 : preparedstatement statementrenew = connrenew.preparestatement ( “选择*从tnews那里fsubjectid = '1 '秩序fdate的ASC ” ) ;
6 : ResultSet中更新= statementrenew.executequery ( ) ;发生错误行:四在JSP的文件: /网页/ specificnews - change.jsp
mm_connlzs_string解决不了的
1 : < % @页的ContentType =的“ text / html ;字符集= gb2312 ”语文= “ Java的”进口= “ java.sql .* ”进口= “ java.sql.drivermanager ” % >
2 : < %
3 :司机driverrenew = (司机) class.forname ( mm_connlzs_driver ) 。 newinstance ( ) ;
4 :连接connrenew = drivermanager.getconnection ( mm_connlzs_string , mm_connlzs_username , mm_connlzs_password ) ;
5 : preparedstatement statementrenew = connrenew.preparestatement ( “选择*从tnews那里fsubjectid = '1 '秩序fdate的ASC ” ) ;
6 : ResultSet中更新= statementrenew.executequery ( ) ;
7 :布尔renew_isempty = ! renew.next ( ) ;
发生错误行:四在JSP的文件: /网页/ specificnews - change.jsp
mm_connlzs_username解决不了的
1 : < % @页的ContentType =的“ text / html ;字符集= gb2312 ”语文= “ Java的”进口= “ java.sql .* ”进口= “ java.sql.drivermanager ” % >
2 : < %
3 :司机driverrenew = (司机) class.forname ( mm_connlzs_driver ) 。 newinstance ( ) ;
4 :连接connrenew = drivermanager.getconnection ( mm_connlzs_string , mm_connlzs_username , mm_connlzs_password ) ;
5 : preparedstatement statementrenew = connrenew.preparestatement ( “选择*从tnews那里fsubjectid = '1 '秩序fdate的ASC ” ) ;
6 : ResultSet中更新= statementrenew.executequery ( ) ;
7 :布尔renew_isempty = ! renew.next ( ) ;
发生错误行:四在JSP的文件: /网页/ specificnews - change.jsp
mm_connlzs_password解决不了的
1 : < % @页的ContentType =的“ text / html ;字符集= gb2312 ”语文= “ Java的”进口= “ java.sql .* ”进口= “ java.sql.drivermanager ” % >
2 : < %
3 :司机driverrenew = (司机) class.forname ( mm_connlzs_driver ) 。 newinstance ( ) ;
4 :连接connrenew = drivermanager.getconnection ( mm_connlzs_string , mm_connlzs_username , mm_connlzs_password ) ;
5 : preparedstatement statementrenew = connrenew.preparestatement ( “选择*从tnews那里fsubjectid = '1 '秩序fdate的ASC ” ) ;
6 : ResultSet中更新= statementrenew.executequery ( ) ;
7 :布尔renew_isempty = ! renew.next ( ) ;
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息