日期:2014-05-17 浏览次数:20700 次
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8" session="true"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<%
String SqlQuery="SELECT * FROM binary_system";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/zhengshi","root","zky");
Statement sql=conn.createStatement();
ResultSet rs=sql.executeQuery(SqlQuery);
%>
<script type="text/javascript">
var onecount;
onecount=0;
subcat = new Array();
<%
int count = 0;
while(rs.next()){
%>
subcat[<%=count%>] = new Array("<%=rs.getString("element1")%>",
"<%=rs.getString("element2")%>","<%=rs.getString("phase")%>");
<%
count++;
} rs.close();
%>
onecount=<%=count%>;
function select1(locationid)
{
document.myform.erji.length = 0;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][0].equals(locationid))
{
document.myform.erji.options[document.myform.erji.length] = new
Option(subcat[i][1]);
}
}
&nb