B
billrobin
Unregistered / Unconfirmed
GUEST, unregistred user!
出错提示:
500 Servlet Exception
/testora.jsp:26: cannot resolve symbol
symbol : method ExecuteQuery (java.lang.String)
location: interface java.sql.Statement
ResultSet rs=stmt.ExecuteQuery(sql);
^
1 error
错误提示:
[15:22:20.894] /testora.jsp:26: cannot resolve symbol
[15:22:20.894] symbol : method ExecuteQuery (java.lang.String)
[15:22:20.894] location: interface java.sql.Statement
[15:22:20.894] ResultSet rs=stmt.ExecuteQuery(sql);
[15:22:20.894] ^
[15:22:20.894] 1 error
[15:22:20.894]
程序源代码:
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<body>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbcdbc:ODBCCQSI";
String Myuser ="cqsi";
String Mypassword ="roft";
Connection conn=DriverManager.getConnection(url,Myuser,Mypassword);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql="Select * from JCYH";
ResultSet rs=stmt.ExecuteQuery(sql);
while(rs.next())
{
%>
<%=rs.getString (1) %>
<%=rs.getString (2) %>
<%
}
%>
<%
rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
500 Servlet Exception
/testora.jsp:26: cannot resolve symbol
symbol : method ExecuteQuery (java.lang.String)
location: interface java.sql.Statement
ResultSet rs=stmt.ExecuteQuery(sql);
^
1 error
错误提示:
[15:22:20.894] /testora.jsp:26: cannot resolve symbol
[15:22:20.894] symbol : method ExecuteQuery (java.lang.String)
[15:22:20.894] location: interface java.sql.Statement
[15:22:20.894] ResultSet rs=stmt.ExecuteQuery(sql);
[15:22:20.894] ^
[15:22:20.894] 1 error
[15:22:20.894]
程序源代码:
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<body>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbcdbc:ODBCCQSI";
String Myuser ="cqsi";
String Mypassword ="roft";
Connection conn=DriverManager.getConnection(url,Myuser,Mypassword);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql="Select * from JCYH";
ResultSet rs=stmt.ExecuteQuery(sql);
while(rs.next())
{
%>
<%=rs.getString (1) %>
<%=rs.getString (2) %>
<%
}
%>
<%
rs.close();
stmt.close();
conn.close();
%>
</body>
</html>