个人空间设计

时间:2018-06-13 14:49:55
【文件属性】:

文件名称:个人空间设计

文件大小:3.25MB

文件格式:RAR

更新时间:2018-06-13 14:49:55

个人空间设计

java开发 课程设计public Map queryUser(String email,String password){ Map map=new HashMap(); Connection con=Conne.getCon(); ResultSet rs=null; PreparedStatement ps=null; String sql="select * from users where email=? and password=?"; try { ps=con.prepareStatement(sql); ps.setString(1,email); ps.setString(2,password); rs=ps.executeQuery(); if(rs.next()){ map.put("id",rs.getInt("id")); map.put("age",rs.getInt("age")); map.put("birth",rs.getString("birth") ); map.put("city", rs.getString("city")); map.put("email",rs.getString("email") ); map.put("nickname",rs.getString("nickname") ); map.put("password", rs.getString("password")); map.put("school", rs.getString("school")); map.put("sex",rs.getString("sex") ); map.put("tel", rs.getString("tel")); map.put("name",rs.getString("name")); } } catch (SQLException e) { e.printStackTrace(); } return map; }


网友评论