- 论坛徽章:
- 0
|
<%@ page contentType="text/html;charset=Big5"%>;
<%@ page import="java.sql.*"%>;
<html>;
<body>;
<select size="1" name="file_show">;
<%
Class.forName("com.informix.jdbc.IfxDriver" .newInstance();
String url = "jdbc:informix-sqli://10.11.12.9:9042/ds:INFORMIXSERVER=on_tcp42;user=pk0081;password=pk0081";
Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from user";
ResultSet rs=stmt.executeQuery(sql);
while (rs.next())
{
out.print("<option value=" + rs.getString(2) + ">;" + rs.getString(1) + "</option>;" ;
}
%>;
</select>;
</body>;
</html>;
注明﹕user表里面有兩個子段﹐分別是name,password
為什么下拉條上只會顯示String(1)中的內容呢 可是分明又抓出來了數據呀
比如 可以抓出兩個字段分別是﹕name:siemen password:yuanmeng
可是下拉條上只能看到siemen
不知道有沒有說清楚哦 ﹕) |
|