如何对数据库表记录删除JSP中 delete from table where ID= ?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <%@ page contentType="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为你的数据库的SID String user="scott"; String password="tiger"; Connection conn= DriverManager.getConnection(url,user,password); Statement stmt=conn.createStatement(); String sql="delete from table where ID= 123"; stmt.executeQuery(sql); stmt.close(); conn.close(); %> </body> </html> 正则表达式 hql:想实现多表关联并去重问题 为什么我的DWR只推送了一次? 关于XML与SERVLET的配置问题. 如果异常断电的情况发生,怎样才能让发生异常的机器的SESSION在数据库中消失! 来看看啊急死了~~~~~~~~~~~~~~~~~~~~! ajax技术怎么用? 有人知道jive的源代码再那下载吗??? 关于JSP安装? 音乐播放 如何在javascript中写一个定时滚动程序,类似股票显示屏,非常感谢! ☆☆☆高手问题:关于JSP include和taglib的问题??☆☆☆
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";
//orcl为你的数据库的SID
String user="scott";
String password="tiger";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="delete from table where ID= 123";
stmt.executeQuery(sql);
stmt.close();
conn.close();
%>
</body>
</html>