Cat c;
c = new Cat();
c
hsession
hsession
tx
HibernateUtil
out
}
%>
Add New Cats:<br>
<form method=post action=addCat
Name:<input name=name><br>
<input type=submit name=
</form>
</body>
</html>
第六個文件
<%@ page import=
java
<html>
<head>
<title>Hibernate Test</title>
</head>
<body bgcolor=
<h
<a href=addCat
<p> ID Name </p>
<%
SessionFactory sessionFactory;
net
hsession = HibernateUtil
Transaction tx = hsession
Query query = hsession
for (Iterator it = query
Cat cat = (Cat) it
out
}
tx
HibernateUtil
out
%>
</body>
</html>
說明
javac
有
[
From:http://tw.wingwit.com/Article/program/Java/ky/201311/29030.html