facebook

Can we able Execu INSERT STATEMENT hibernate CreateSQLQUERY

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #281080 Reply

    schanamolu
    Member

    Hi Guys,

    Can we use following sample code to insert a row using Oracle Insert statement

    return getHibernateTemplate().executeFind(new HibernateCallback() {
    public Object doInHibernate(Session session)
    throws HibernateException {

    SQLQuery tempQuery = session.createSQLQuery(“Insert into COMPANY(COMPANY_NAME, COMPANY_ID) values (“NortelNetworks”, “NT”);

    Let me know.

    Also how I can retrieve Primary key “NT” when it catches exception in exception clause.
    Exception is due to Unique Constraint Violation.

    Any response would be appreciated.

    Thanks,
    Sreedhar.

    Thanks,
    Sreedhar.

    #281888 Reply

    Riyad Kalla
    Member

    Sreedhar,
    You might want to post this to the Hibernate forums as well.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Can we able Execu INSERT STATEMENT hibernate CreateSQLQUERY

You must be logged in to post in the forum log in