1
如果我使用Hibernate,必須關閉ResultSet
和CallableStatement
嗎?例如:關閉resultSet和callableStatement
CallableStatement cstmt = sessionFactory.getCurrentSession()
.connection()
.prepareCall("{? = call PREQUEST.GetRequestList(?,?)}");
cstmt.registerOutParameter(1, OracleTypes.VARCHAR);
cstmt.setString(2, sessionId);
cstmt.executeUpdate();
cstmt.close(); // Closing
return cstmt.getString(1);
注意:從會話中獲取[connection](http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/Session.html#connection())被標記爲已棄用且已計劃去除。 – A4L 2014-09-23 07:31:43