日期:2014-05-17 浏览次数:20694 次
public boolean UserUpdate(String username, String password, String password1) {
Session session = hibernatetemplate.getSessionFactory().openSession();
Query query = session.createSQLQuery("update user set username='"
+ username + "',password='" + password1 + "' where password='"
+ password + "'");
query.executeUpdate();
session.beginTransaction().commit();
if (session.createSQLQuery(
"select * from user where username='" + username
+ "' and password='" + password1 + "'").list().size() >= 1) {
return true;
} else {
return false;
}
}