Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Dao {
- public List<MyTable> getNewRows() throws Exception {
- Session session = null;
- List<MyTable> result;
- try {
- session = HibernateUtil.getSessionFactory().openSession();
- result = session.createQuery("from MyTable where state = 0 ").list();
- } catch (Exception e) {
- throw e;
- } finally {
- session.close();
- }
- return result;
- }
- }
- <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/db</property>
- <property name="hibernate.connection.username">login</property>
- <property name="hibernate.connection.password">pass</property>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement