String sql="select myname ,myage from mypersons where 1=1";
或者
String sql="select myname ,myage from mypersons where myname =?";
PreparedStatement statement=connect.prepareStatement(sql);
statement.setString(1, "sss");
ResultSet results=statement.executeQuery();
String sql = "select * from user where id = ?"
PrepatedStatement pstmt = connection.preparestatement(sql);
pstmt.setInt(1,id);
你把代码贴出来看看