|
我在批量提jiao复选框的shi候出现了一些问题,具体問题如下:
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ page import="java.sql.,net.song.db."%>
<%
int seatCount = 0;
Connection conn = null;
ResultSet rs = null;
try {
conn = DB.getConn();
String sql = "select count(1) from seat where isSeat = " + false;
rs = DB.executeQuery(conn, sql);
rs.next();
seatCount = rs.getInt(1);
} finally {
DB.close(rs);
DB.close(conn);
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv2="pragma" c>
<meta http-equiv="cache-control" c>
<meta http-equiv="expires" c>
<meta http-equiv="keywords" c>
<meta http-equiv="description" c>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="showSeat.jsp" method="get">
<%
for (int i = 0; i < seatCount; i++) {
%>
zuowei<%=i + 1%>:
<input type="checkbox" name="seat" id="i">
<%
}
%>
<input type="submit">
</form>
</body>
</html>
我的数据库只有两個zi段,一个是座位編号id,一個是座位zhuang态isseat,初始值为false!
在de到quan部zuo位后,tongguo复选框,選zhong的座位后在点击ti交后,zai数据库中将isseat修改为ture。
我該怎么做呢?给点提shi就好,谢谢!
欢迎lai到Java学习Zhe论坛,转载請注明地址:http://www.javaxxz.com. |
|