日期:2014-05-20 浏览次数:20707 次
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> <style type="text/css"> <!-- .style1 { color: #000000; font-size: 24px; } .style3 {font-size: 16px} --> </style> </head> <body> <% Class.forName("com.mysql.jdbc.Driver"); //载入驱动程序类别 String url = "jdbc:mysql://localhost:3306/cangku"; String user = "root"; String pwd = "long"; Connection con = DriverManager.getConnection(url, user, pwd); //建立数据库链接,studentdata为ODBC数据源名称 //建立Statement对象 Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); %> <center> <h2 class="style1">删除货物信息</h2> <br> <form name="form1" method="post" action="ChuKu_2.jsp"> <p><span class="style3">请选择要删除的货物的名称: </span> <select name="name"> <% ResultSet rs = stmt.executeQuery("SELECT * FROM ruku"); while (rs.next()) { String name = rs.getString("name"); %> <option value="<%=name%>"><%=name%></option> <%}%> } </select> </p> <p> <input type="submit" name="queding" value="确定"> <input type="reset" name="chongzhi" value="重置"> <input name="back" type="button" id="back" value="返回" onClick="javascript:history.go(-1)"> </p> </form> </center> </body> </html>