Does this Hibernate generated SQL mean anything to anyone?
From: IINET (mjinteractive_at_iinet.net.au)
Date: 12/23/04
- Next message: Mark Scott: "Re: Hibernate not finding Oracle driver - despite straight JDBC working"
- Previous message: bjwang_at_acs.com.tw: "How to put traditional Chinese text into Unicode Oracle 9i database via Internet Explorer"
- Next in thread: Mark Scott: "Re: Does this Hibernate generated SQL mean anything to anyone?"
- Reply: Mark Scott: "Re: Does this Hibernate generated SQL mean anything to anyone?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Dec 2004 15:48:31 +0800
Generated sql:
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: insert into PERSON (name, address, id) values (?, ?, ?)
Everything seems to be working - no errors at all. But my class is not being
saved to the database! I get the session, do the save, the flush etc - but
no action in the database itself.
Should I not be seeing the actual SQL and not the ? ? ? business? My class
is folowing all the right rules (private members, no arg constructor etc
CODE:
Person person1 = new Person();
person1.setName("Basil Fawlty");
person1.setAddress("Fawlty Towers, UK");
try {
Session session = HibernateUtil.currentSession();
session.save(person1);
session.flush();
HibernateUtil.closeSession();
} catch (Exception ex) {
System.out.println("Problem with servlet code: " + ex.getMessage());
}
help appreciated.
- Next message: Mark Scott: "Re: Hibernate not finding Oracle driver - despite straight JDBC working"
- Previous message: bjwang_at_acs.com.tw: "How to put traditional Chinese text into Unicode Oracle 9i database via Internet Explorer"
- Next in thread: Mark Scott: "Re: Does this Hibernate generated SQL mean anything to anyone?"
- Reply: Mark Scott: "Re: Does this Hibernate generated SQL mean anything to anyone?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|