public boolean add(User user) { boolean flag = false; try { conn = DBconnection.getConn(); String sql = "insert into tb_user values(?,?)"; ps = conn.prepareStatement(sql); ps.setString(1, user.getU_name()); ps.setString(2, user.getU_pass()); flag = !ps.execute(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { DBconnection.close(conn, ps, null); } return flag; }
添加回答
举报
0/150
提交
取消