-->
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: stored procedure doesn't seem to be executed
PostPosted: Fri Sep 10, 2004 6:45 am 
Newbie

Joined: Fri Sep 10, 2004 5:55 am
Posts: 2
Hibernate version:2.1.5

Name and version of the database you are using:MSSQL Server 8

Hello,
I'm trying to call stored procedure using hibernate.
My code is following:

String query = "exec storedProc";
Session sess= (Action.getSessionFactory()).openSession();
Connection conn = sess.connection();
Statement st = conn.createStatement();
conn.commit();
//conn.close();
sess.close();

my hibernate.properties file:
hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
hibernate.connection.datasource=java:comp/env/jdbc/DB
hibernate.show_sql=true

The problem is that aldow I don't get any exceptions the stored procedure doesn't do anything (I tried to print query to console, and paste it to query analizer. The query is valid). If you know how to solve this, please help. It's been driving my crazy for couple of hours :(


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2004 6:52 am 
Newbie

Joined: Fri Sep 10, 2004 5:55 am
Posts: 2
Sorry. I've deleted some code betweend comments. The code naturally contains alsow line - st.executeQuery( query );

String query = "exec deleteSkin '"+nazwa+"'";
Session sess= (Action.getSessionFactory()).openSession();
Connection conn = sess.connection();
Statement st = conn.createStatement();
ResultSet res = st.executeQuery( query );
conn.commit();
//conn.close();
sess.close();


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.