这是我的代码
<%
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:firstdb";
conn = DriverManager.getConnection(url,"admin3","admin3");
stmt=conn.createStatement();
String sql="select * from goodinf";
rs=stmt.executeQuery(sql);
while(rs.next()){
%>
<tr>
<th scope="col"><%=rs.getObject(1) %></th>
<th scope="col"><%=rs.getObject(2) %></th>
<th scope="col"><%=rs.getObject(3) %></th>
<th scope="col"><%=rs.getObject(4) %></th>
<th scope="col"><%=rs.getObject(5) %></th>
<th scope="col"><%=rs.getObject(6) %></th>
<th scope="col"><%=rs.getObject(7) %></th>
<th scope="col"><%=rs.getObject(8) %></th>
<th scope="col"><%=rs.getObject(9) %></th>
<th scope="col"><a href="del.jsp?age=<%=rs.getObject(1)%>">删除</a></th>
</tr>
<%
}
}catch(SQLException e){
e.printStackTrace();
}
%>
就这个链接总是连不上,不知道是为什么
[此贴子已经被作者于2007-4-8 15:04:08编辑过]