-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem in executing procedure using hibernate and postgreSQ
PostPosted: Tue Nov 10, 2009 9:40 am 
Newbie

Joined: Tue Nov 10, 2009 9:32 am
Posts: 1
Hi ,
I m trying to execute a procedure using hibernate.
My dataabse is postgreSQL and i m using hibernate 3.0.
This is my below code.

Code:
   
java.sql.Connection con = session.connection();
java.sql.CallableStatement cs = con.prepareCall("select sampleFunc1(:param1)");
cs.setInt("param1",1);
cs.executeQuery();
con.close();


I know the xml way of executing the procedure .
but in my case the procedure name will come from runtime .
so following this technique.

when i execute this i m getting the following error.

Quote:
class org.postgresql.jdbc2.Jdbc2CallableStatement
Exception in thread "main" java.lang.AbstractMethodError: org.postgresql.jdbc2.Jdbc2CallableStatement.setInt(Ljava/lang/String;I)V



I bascially have two doubts.
1.Is this a correct way or executing procedures ?? (I cannot use the xml way because the procedure name is not known)
so for calling a parameterised procedure via hiberante is there any better way.
2.I tried to google and find the reason for error . i can see its an abstract class in postgreSQL dialect . so is there a way to solve this problem

Hope someone will show me some way out :-) :-)
Thanks in advance
---------------------
Ashok


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

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.