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