jsp删除表中数据
<%
String id1=request.getParameter("id"); //肯定能获取到
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String mypath=request.getRealPath("/"); //获取网站根目录路径
String url="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+mypath+"data/database.mdb";
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
String shanchu="DELETE from liuyanbiao WHERE 编号="+id1;
ResultSet rs=stmt.executeQuery(shanchu);
while (rs.next()) {
out.print("删除成功!");
}
con.close();
%>
帮忙解决一下,红色的地方,老是出错
你用executeQuery当然会出错了,你是要执行删除操作哎
改成用executUpdate就ok了
报什么错。改为:看看
stmt.executeUpdate(shanchu);
不行呀
org.apache.jasper.JasperException: Unable to compile class for JSP:
报的错
An erro
相关问答:
我现在想用ssh整合来做一个论坛,但数据库方面不行,我主要不会涉及数据库,不知道发帖表,和回帖表要如何设计和区分。不知道谁有一个简单的思路,来设计这些表。谢谢了。
发帖和回帖用同一张表 。发帖 id user ......
我的开发的平台是Myeclipes6.0 + tomcat5.x + mysql
我所有的编码方式都是用的UTF-8
我只用了Strtus框架
在一个form中如下用的是post的提交方式:
<form class="form" action=&quo ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
jsp中include.inc的作用是什么?
include.inc啥意思?没听说过
Java code:
<%include file="include.inc"%>加载网站目录include.inc文件内容
包含一个静态页面吧···
& ......
一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录
然 ......