|
Java学习者论坛
<%@ page contentType="text/HTML;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%request.setCharacterEncoding("gb2312");%>
<%
String bm=request.getParameter("bm");
String syz=request.getParameter("syz");
String eq=request.getParameter("eq");
String type=request.getParameter("type");
String peiz=request.getParameter("peiz");
String ghpz=request.getParameter("ghpz");
Connection con;
Statement sql;
ResultSet ts;
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{ out.print(e);
}
try{ con=DriverManager.getConnection("jdbcdbc:whb","sa","8u8u9009");
sql=con.createStatement();
ts=sql.executeQuery("select cpu from peizb,syz where peizb.lsh=syz.dm and syz.syz='姓名");
int rs=sql.executeUpdate("insert into ghpz(bm,syz,eq,type,peiz,ghpz,bad) values ('"bm"','"syz"','"eq"','"type"','"peiz"','"ghpz"','"ts.getString(1)"')");
if( rs!=0)
{
if(type.trim().equals("报废"))
{
int ps=sql.executeUpdate("update peizb set cpu='"ghpz"' from syz where peizb.lsh=syz.dm and syz='"syz"'");
response.sendRedirect("sbgl.jsp");
}
}
else
{
out.print("记录没有增加成功");
}
con.close();
}
catch(SQLException e)
{
out.print(e);
}
%>
</body>
</html>
出现
java.sql.SQLException: [Microsoft][ODBC 驅动程序管理器] 无效的游标状态
这个怎么回事。。。帮忙分析一下谢谢
欢迎来到Java学习者论坛,轉载請注明地址:http://www.javaxxz.com. |
|