JSP查询数据库

JSP查询数据库
MyJsp

<% Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; String sql = "slecte * from users";
编号 姓名 年龄 用户名 密码

conn= DBUtil.getConn();
try {
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();

while(rs.next()){
%>

<%=rs.getInt("id")%> <%=rs.getString("name")%> <%=rs.getInt("age")%> <%=rs.getString("user_name")%> <%=rs.getString("pwd")%> <% } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } DBUtil.close(conn, ps, rs); %>

JSP查询数据库

相关文章:

  • 2021-12-07
  • 2021-08-06
  • 2021-08-07
  • 2021-08-15
  • 2021-08-28
  • 2021-08-28
  • 2021-09-29
  • 2021-11-13
猜你喜欢
  • 2021-09-29
  • 2021-09-29
  • 2021-09-11
  • 2021-08-06
  • 2021-10-29
  • 2021-09-27
  • 2020-05-01
  • 2021-01-18
相关资源
相似解决方案