String sql="insert into userlist(userId,userName, passw ,contactTel,email) " +
"values(?,?,?,?,?)";
Connection conn=null;
PreparedStatement pstmt=null;
try {
conn=util.getConnection();
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,user.getPersonName());
} catch (SQLException e) {
e.printStackTrace();
}finally{
util.colse(pstmt);
util.colse(conn);
答案应该是要把它转一下
pstmt.setString(1,((user)user).getUserId());
qq_花开花谢_0
跃然一笑
相关分类