PreparedStatement and Hibernate session
Hi, I want to retrieve a Preparedstatement object from a hibernate Session but now that the connection() method of hibernate Session has been Deprecated, how do I do it.
I want to achieve same result which could be achieved by the the below code:
Quote:
SessionFactory sessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
private Session session =sessionFactory.openSession();
PreparedStatement st = session.connection().prepareStatement("{update DMETERS dm set dm.shape = ? where dm.objectid = ?}");
st.setString(1,"value for shape" );
st.setString(2, objectid);
st.execute();
The problem with the above code is that the "st" object is null when it executes since the connection method has been Deprecated...I may be wrong....any ideas, referrals would be appreciated.
Could you post the impl code
What is impl. here?
Could you please code the complete code please?
Aslos how do you manage closing the commenction?
Thanks,