日期:2014-05-20 浏览次数:20677 次
String ques="ques";
String quesNum;
String insertQues;
for(int m=1;m<=2;m++){
int m=1;
quesNum=ques+m;
insertQues="update question.testPage set '"+quesNum+"'='"+result[m]+"' where userID='"+username+"'";
stmt.execute(insertQues);
ques="";
}
String sql="select * from test where usernmae=? and password=?";
PreparedStatement psm=conn.preparedStatement(sql);
psm.setString(1,myname);
psm.setString(2,mypasswd);
Result rs=psm.executeQuery();
if(rs.next){
rs.close();
con.close();
return false;
}
else{
rs.close();
con.close();
return true;
}