Not Found (404)
The file that you requested could not be found on this server. If you provided the URL, please check to ensure that it is correct. If you followed a hypermedia link, please notify the administrator of that server of this error.代码:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:ORACLE9I";
String user="scott";
String password="tiger";
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="select * from emp";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {
%>
第一个字段内容为:<%=rs.getString(1)%>
第二个字段内容为:<%=rs.getString(2)%>
<%
}
%>
<% out.print("数据库联接成功,恭喜您!");%>
<%rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
The file that you requested could not be found on this server. If you provided the URL, please check to ensure that it is correct. If you followed a hypermedia link, please notify the administrator of that server of this error.代码:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:ORACLE9I";
String user="scott";
String password="tiger";
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="select * from emp";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {
%>
第一个字段内容为:<%=rs.getString(1)%>
第二个字段内容为:<%=rs.getString(2)%>
<%
}
%>
<% out.print("数据库联接成功,恭喜您!");%>
<%rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货