-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem executing simply update statement
PostPosted: Thu Apr 12, 2007 12:45 pm 
Newbie

Joined: Sat Dec 02, 2006 1:09 am
Posts: 12
I have an update statement in my .java file in the form of a String.

String sql = "update ".. and so on.

Now I want to use hibernate to execute the update statement. I want to pass a method provided by hibernate a String that contains an update statement.

I have read Chapter 16. Native SQL, but it did not provide me with an example that I could use.

any help would be most appreciated , Hibernate is heavy!!!


pb


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 1:16 pm 
Beginner
Beginner

Joined: Thu Apr 12, 2007 10:43 am
Posts: 21
Location: Brazil
If your UPDATE statement is in HQL, use SessionFactory.createQuery("UPDATE ...").executeUpdate(). If you're using plain SQL, try SessionFactory.connection().prepareStatement("UPDATE ...").executeUpdate().


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.