Joined: Tue Apr 11, 2006 2:59 pm Posts: 2
|
return (Float) XXUtil.XXXXXX.runInSession(new HibernateLogic() {
public Object run(Session session) throws HibernateException {
Connection conn = session.connection();
PreparedStatement stmt = null;
try {
stmt = conn.prepareStatement("Query..."); stmt.setString(1, XXXXXXX); ResultSet rs = stmt.executeQuery();
} catch (XXException e) {
throw new HibernateException(e);
} finally {
if (conn != null) {
conn.close();
}
} catch (Exception e) {
}
}
}
});
Question : Can I close connection within run(Session session).
Note : I am creating the connection with the run anonymous method..
Please let me know
Regards
Paul
|
|