rs cannot be resolved
发布网友
发布时间:2023-07-14 11:14
我来回答
共1个回答
热心网友
时间:2024-12-05 10:19
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
out.println("数据库驱动注册成功!<br>");
String url="jdbc:odbc:jspdb";
String user="sa";
String password="sa";
Connection conn=DriverManager.getConnection(url,user,password);
out.println("数据库连接成功!<br><hr>");
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from trade";
ResultSet rs=stmt.executeQuery(sql);
rs.first();
%>