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;
}
慕大叔
大咪
摩诃迦叶