2011-06-22 28 views
0

IM使用我的JSP頁面和MySQL冬眠,我知道如何保存這樣的會話:如何使用Hibernate來登錄電子在JSP頁面中

<%Session hibernateSession = MyDB.HibernateUtil.currentSession(); Transaction tx = hibernateSession.beginTransaction(); 
Student std = new Student(); 
std.setUserName("David"); 
hibernateSession.save(std);%> 

,但如何從一個selecte表和打印它像在mysql select * from student wher userName = ***和我如何更新?

finaly我可以在登錄中使用hibernate嗎?

+1

只使用一個查詢 – Dilllllo

+0

我該如何使用它? – David

回答