Java code
pageEncoding="gb2312"%>
执行打印记录的信息//获取当前页编号ID的值
String ID = (String) request.getParameter("ID");
String dllname= (String) request.getParameter("dllname");
//定义您的驱动器及数据库的URL、用户名和密码
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String url = "jdbc:sqlserver://192.168.0.2:1433;databaseName=klrq";
String username = "SA";
String password = "GUOOUG";
Connection con = null;
try {
// 创建数据库连接
Class.forName(driverName);
con = DriverManager.getConnection(url, username, password);
// 创建数据库执行语句
Statement sqlstatement = con.createStatement();
// 将对应编号ID是否打印字段改为true
sqlstatement
.execute("exec yu @id='" + ID + "', @dllname='"+ dllname + "'");
con.close();
} catch (Exception e) {
e.printStackTrace();
}
%>