try{
conn=DB.getConn();
String sql = "select userid from users where username = '"+username+"';select jztypeid from jztype where jztypename='"+jztype+"'";
pstmt = DB.getPStmt(conn, sql);
int userid =
pstmt.executeUpdate();
}catch(SQLException e){
e.printStackTrace();
}
就是userid和typeid怎麼寫能獲取數據庫裡取過來的值
ResultSet rs=pstmt.executeQuery(sql);
Users users = new Users();
while(rs.next()){
user.getUserid(rs.getInt("userid"));
users.getTypeid(rs.getInt("typeid"));
}
userid,typeid與表裡字段相同