Comment

Andre
Calling stored procedure from Hibernate with Java,
March 2, 2008 at 7:03 PM

Hello,
First of all, congratulations to keep a lot of documentation about hibernate in one place: it's help a lot !
I need to call an stored procedure in oracle from Hibernate (see bellow) that has 1 input parameter and 2 return values. I'm receiving and error from Oracle (invalid column index). Any help is appreciated.
Thanks in advance !!!

HBM file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="br.com.gppg.dto.csep_Busca_Vinc_Matr">
<cache usage="read-only"/>
<id name="usuario" column="P_USERID"/>
<property name="vinculo" column="P_VINCULO"/>
<property name="matricula" column="P_MATRICULA"/>
<loader
query-ref="CSEP_BUSCA_VINC_MATR"/>
</class>
<sql-query name="CSEP_BUSCA_VINC_MATR" callable="true" >
<return alias="vinc_matr" class="br.com.gppg.dto.csep_Busca_Vinc_Matr" lock-mode="read">
<return-property name="vinculo" column="P_VINCULO"/>
<return-property name="matricula" column="P_MATRICULA"/>
</return>
{call CSEP_BUSCA_VINC_MATR(:ID_USUARIO,{vinc_matr.vinculo},{vinc_matr.matricula})}
</sql-query>
</hibernate-mapping>

Code to call it:

session = HibernateUtil.currentSession();
Query query = session.getNamedQuery("CSEP_BUSCA_VINC_MATR");
query.setString("ID_USUARIO", "tstgp");


Here is error message:
INFO [STDOUT] Hibernate: {call CSEP_BUSCA_VINC_MATR(?,{vinc_matr.vinculo},P_MATRICULA)}
WARN [JDBCExceptionReporter] SQL Error: 17003, SQLState: null
ERROR [JDBCExceptionReporter] Invalid column index

View All Comments
Related Tutorial and Articles
Hibernate Questions

Hibernate - Hibernate
Hibernate  how to update record by calling stored procedure from java prog using hibernate query   Hibernate update query http://www.roseindia.net/hibernate/hibernate-update.shtml This will show you how to update 

Hibernate Questions

hibernate
hibernate  how to execute a sequence(in database) from Hibernate program or java program   Please visit the following link: Hibernate Tutorials 

Hibernate Questions

Hibernate
the example from Hibernate Getting Started Tutorial. Please follow the steps... of Hibernate. I followed all th steps as given in the tutorial, but a build error is coming in all the java files, saying that the import org.hibernate.*; can 

Hibernate Questions

Hibernate - Hibernate
Hibernate  how to call the stored procedure in mysql database server using hibernate..??  Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate Thanks 

Hibernate Questions

Hibernate Code - Hibernate
Hibernate Code   How to Invoke Stored Procedure in Hibernate???????? Plz provide details code 

Hibernate Questions

Hibernate - Hibernate
Hibernate   Dear sir Thanks for your previous answers its really help me a lot. This is my question : I had 2 application(Java, spring ,hibernate, jboss, oracle) one is 1) Express and 2) MDM(All master data 

Hibernate Interview Questions

Hibernate Code - Hibernate Interview Questions
Hibernate Code  This is the question asked in CAPEGEMINI Write a sample code how to persist inner class,interface,final class and how to invoke stored procedure in hibernate? From Surjeet 

Hibernate Questions

hibernate
time Hibernate allows to map the Java objects to the relational database. Hibernate... the components from the Hibernate framework selectively. Hibernate can be used...why hibernate?  why hibernate?   Hibernate: -Hibernate 

Hibernate Questions

hibernate
hibernate  Is there any other way to call procedure in hibernate other than named query????? if we are using session object to get the connection then why hibernate we can directly call by using a simple java class??????? please 

Hibernate Questions

creating and executing stored procedure using hibernate
creating and executing stored procedure using hibernate  I have to execute following query using hibernate DECLARE @i_STARTDATETIME DATETIME DECLARE @i_ENDDATETIME DATETIME DECLARE @o_ERRORCODE INT DECLARE @o_ERRORDESCRIPTION 

Hibernate Questions

Hibernate
Hibernate  Can we write more than one hibernate.cfg.xml file... ? if so how can we call and use it.? can we connect to more than one DataBase from a single Hibernate program 

Hibernate Questions

hibernate - Hibernate
hibernate  what is hibernate and how to make a pc hibernating?  Hi friend, Hibernate is based on object oriented concept like java. It has better compatibility with java than sql. In Jdbc we have to mannualy 

Hibernate Questions

Hibernate - Hibernate
= sessionFactory.openSession(); String SQL_QUERY ="from Procedure proced"...Hibernate SessionFactory  Can anyone please give me an example of Hibernate SessionFactory?  Hi friend,package roseindia;import 

Hibernate Questions

HIbernate call for sequence - Hibernate
HIbernate call for sequence  I have created a sequence in oracle table. Now how to access this in java class through hibernate from dual table i am..._S is this the right way to retrive the next value from 

Hibernate Questions

Java Hibernate
Java Hibernate  Sir, I want to learn hibernate but i don't know JSP. How & from Where i can start to learn hibernate?   Hello Friend, Please go through the following link: Hibernate Tutorials Here you will get 

Hibernate Interview Questions

Hibernate sample code - Hibernate Interview Questions
Hibernate sample code  Hi Can any body tell me how to persist inner class,abstract class,final class,and interface in hibernate. From... Hibernet.org.The Hibernate 3.0 core is 68,549 lines of Java code together with 27,948 lines 

Hibernate Questions

Hibernate
Hibernate  how to use pagination concept in Hibernate 

Java Beginners

hibernate
hibernate  how to uses optional column in hibernate 

Hibernate Questions

how to Integrate MULE and HIBERNATE - Hibernate
beans for all my java classes. but i am not able to integrate MULE with Hibernate...how to Integrate MULE and HIBERNATE  hi, i am having a simple JSP... from the page and store into DB(MYSQL). Mule is used to expose my JSP 

Hibernate Questions

hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application 

Hibernate Questions

hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application 

Hibernate Questions

hibernate - Hibernate
hibernate  hi i am new to hibernate. i wan to run a select query... hibernate for use SessionFactory sessionFactory = new Configuration...(); //Using from Clause String SQL_QUERY ="from Insurance insurance 

Hibernate Questions

Hibernate - Hibernate
in Hibernate in Tomcat i got an error like this HTTP Status 500... () that prevented it from fulfilling this request. exception..., This type of error comes when JTA(Java Transaction API) is not present 

Hibernate Interview Questions

Hibernate
Hibernate  How do you handle parent - child tables relationships in hibernate? How do you handle Detach state in hibernate 

Hibernate Questions

Hibernate
Hibernate  hello, how to run hibernate program in netbeans?please send me step by step instructions to run hibernate in netbeans 

Training

Hibernate Training
engine. How to persist different types of objects using the Hibernate. How to use HQL (Hibernate Query Language) for querying objects stored in Hibernate. How to integrate Hibernate  

Hibernate Questions

hibernate
hibernate  how to impot mysql database client jar file into eclipse for hibernate configuration   Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate/runninge-xample.shtml Thanks 

Hibernate Questions

hibernate
hibernate  How to know how many columns changed in a table when we are using hibernate 

Hibernate Interview Questions

HIBERNATE
HIBERNATE  How u connects database using hibernate 3.0? Where you have written the database configuration details 

Programming Tutorials

HIBERNATE- BASICS
, subsequently adopted by Oracle and so proprietary. Hibernate from SourceForge and OJB... HIBERNATE- BASICS  (R.S.Ramaswamy)- ( in 3 parts) (part-1) ( CMP-EJB vs. HIBERNATE) (published in DeveloperIQ-July-2005 

Hibernate Questions

hibernate web project - Hibernate
hibernate web project  hi friends,very good morning,how to develop and execute web project using myeclipse ide.plz give me step-by-step procedure... links: http://www.roseindia.net/hibernate/index.shtml http://www.roseindia.net 

Hibernate Questions

How to run? - Hibernate
friends are told hibernate is a new entry to Java. so plz try to tell how to use... to switch any database. Hibernate can be used in Java Swing applications, Java...How to run?  Hiiiiiiiiiiiii friend.. i am Magesh 

Hibernate Questions

Hibernate in java - Hibernate
and Hibernate). Is there any body who can help me out in my task. All I want is an example in Hibernate. " How to configure a login page (user name and password...Hibernate in java  Hi, This is Gopi, I am working 

Hibernate Questions

How to integrate core java with Hibernate
How to integrate core java with Hibernate  How to integrate core java with Hibernate How to integrate core java with Hibernate   xxxxxxxxx   Please visit the following link: Java with Hibernate The above 

Hibernate Questions

Hibernate - Hibernate
Hibernate application development help  Hi, Can anyone help me in developing my first Java and Hibernate application 

Hibernate-Tutorials

Hibernate Collection Mapping
: Here the example is given below will demonstrate you how to stored elements...Hibernate Collection Mapping In this tutorial you will learn about the collection mapping in Hibernate. Hibernate provides the facility to persist 

Hibernate Questions

Hibernate code - Hibernate
Hibernate code   how to write hql query for retriveing data from multiple tables 

Interview Questions

Hibernate Interview Questions - What is Hibernate Framework?
Framework? The Hibernate Framework is open source, Java based ORM framework for persisting the Java objects in the Java programming language. Hibernate... of the Hibernate is that it provides the facility to map Java classes to the database tables 

Java-Tutorials

Hibernate Tutorial
of Hibernate, How to download hibernate, Hibernate Versions etc. What is Hibernate ? Hibernate is a persistence tool for Java (supported versions Java SE... (ORM) framework for Java. Hibernate is provided by the JBoss organization 

Hibernate Questions

Hibernate Annotattions - Hibernate
Hibernate Annotattions  Can anybody tell me here how we can use hibernate annotations which is a new facility in hibernate 3.2 any tutorial and what...; Hi friend, Annotation is the java class which is read through reflection 

Hibernate Questions

hibernate execution - Hibernate
hibernate execution  how to create hibernate pojo classes in eclipse galileo ide. i want steps to this process. i want to retrieve date from mysql database using hibernate in eclipse galileo ide. any one plz send me steps 

Hibernate Questions

Hibernate Search - Hibernate
Hibernate Search  hello i am java developer and mostely concern with that site whenever need to know some java related technology or on other topics... these dayes i am working in "Hibernate Search" it is new and i can't 

Hibernate Questions

java - Hibernate
java  how can we configure many to many relationships in hibernate 

Hibernate-Tutorials

Hibernate Transaction
. Hibernate provides a way to abstract the transaction management from... code as example that will demonstrate how may you use the Hibernate Transaction...Hibernate Transaction In this tutorial you will learn about the Transaction 

Hibernate Questions

About Hibernate - Hibernate
About Hibernate  What is Hibernate? How can i learn it fast.   About HibernateHibernate is an object relational mapping tool for Java... object/relational persistence and query service for Java. Hibernate lets you develop 

Hibernate Questions

Hibernate Subquery - Hibernate
Hibernate Subquery  How to write following sub query query in hibernate? without using the query criteria. only need SQL query SELECT * FROM (SELECT ROWNUM ROW_NUM, A.* FROM ACCOUNT_SITE_INFO as A WHERE ROWNUM <= 100 

Hibernate Questions

Hibernate
Hibernate  How to create Dynamic array of Objects during HQL execution 

Hibernate Questions

java - Hibernate
java  HI guys can any one tell me,procedure for executing spring and hibernate in myeclipse ide,plz very urgent for me,thank's in advance.  .../hibernate/runninge-xample.shtml Thanks 

Hibernate Interview Questions

HIBERNATE
HIBERNATE  What is mean by cache? How many types are there give me one example 

Hibernate Questions

Hibernate
Hibernate  Can we rename hibernate.cfg.xml file name to somename.cfg.xml? if so how can we use 

Hibernate Questions

hibernate - Hibernate
hibernate  how to write join quaries using hql  Hi satish...: http://www.roseindia.net/hibernate/hibernate-aggregate-functions.shtml http://www.roseindia.net/hibernate/associations-and-joins.shtml Thanks 

Hibernate Questions

hibernate - Hibernate
hibernate  hi friends i had one doubt how to do struts with hibernate in myeclipse ide its urgent 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Give me a brief description about Hibernate?How we will use it in programming?give me one example 

Hibernate Questions

hibernate code problem - Hibernate
hibernate code problem  suppose i want to fetch a row from the table through a value which i got from the jsp page. how can i do it and iterate... . Please visit for more information. http://www.roseindia.net/hibernate 

JDBC Questions

receive a ResultSet from a stored procedure
receive a ResultSet from a stored procedure  How do I receive a ResultSet from a stored procedure 

Hibernate Questions

hibernate - Hibernate
hibernate   hi,can any one tell me how to get SQL query in hibernate, when hql fire it will create sql in console when hibernate.cfg.xml property will true, but i want SQL query in one variable how to get it... Thanks satish 

Hibernate Questions

JSP using java - Hibernate
connection. int index=1; while(rs.next()) { HSSFRow row = sheet.createRow((short)index); row.createCell((short)0...).setCellValue(rs.getString(2)); index++; } Now,i m 

Hibernate Questions

Hibernate - Hibernate
one example   Hi mamatha, Hibernate 3.0, the latest Open Source... from Hibernet.org.Hibernate is a solution for object relational mapping... not understandable for anybody learning Hibernate. Hibernate provides a solution to map 

Java Beginners

update date from stored procedure
update date from stored procedure  how to works on insert,update data from stored procedure.   Insert data using stored procedure 

Hibernate Questions

java(Hibernate) - Hibernate
java(Hibernate)  Hai Amardeep This is jagadhish.Iam giving full code... will read hibernate.cfg.xml and prepare hibernate for use SessionFactory... in it by reading them from form object System.out.println("Inserting Record 

Hibernate Questions

Calling hibernate query list() method generates errors
Calling hibernate query list() method generates errors  Hello, I'm trying to debug someone's codes. But I am not an expert of hibernate so I'm asking your help about this. I am trying to retrieve a list of jobs from 

Hibernate Questions

Hibernate Criteria Wildcard Example
Hibernate Criteria Wildcard Example  Hi, How to write Java program to use the Hibernate Criteria Wildcard query and fetch the data from database I want example of Hibernate Criteria Wildcard which is easy to understand 

Hibernate Tutorial Example

Hibernate
from database. Hibernate is Java library which is released under the GNU...Hibernate Hibernate is a framework for Java technology, which is used.... Hibernate is Java library which is used to develop the data access layer 

Hibernate Questions

Hibernate - Hibernate
Hibernate  when I run Hibernate Code Generation wizard in eclipse I'm... getting this error. please let me know, how to resolve.../hibernate/index.shtml Hope that it will be helpful for you. Thanks 

Java Server Faces Questions

jsf &hibernate integration
jsf &hibernate integration  how can i get session factory from hibernate configuration file with java server faces application specially(bean methods 

Hibernate Tutorial Example

Hibernate Overview
The Hibernate framework is an ORM tool for Java. It is very popular among.... Hibernate mediates between Java objects and database store. It takes the Java... the instruction from the Java program and translates into a SQL, executes 

Hibernate Questions

java - Hibernate
java  tell me how to configure hibernate in eclipse,where i have to add jar files and how can i get the jar files please tell me the clear...://www.roseindia.net/hibernate/ Thanks 

Hibernate Questions

Hibernate- Oracle connection - Hibernate
Hibernate- Oracle connection  In Eclipse I tried Windows -->...) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Please let me know How to make a connection to oracle DB from eclipse. Thanks 

Struts Questions

Struts2 and Hibernate
Struts2 and Hibernate  how to fetch database value from one page to another page in struts2 and hibernate 

Hibernate Questions

hibernate - Hibernate
Hibernate; import org.hibernate.Session; import org.hibernate.*; import... Branches.branch_id from Branches branches"; Query query...   Hi Radhika, i think, you hibernate configuration 

Hibernate-Tutorials

Examples of Hibernate Criteria Query
Tutorials Index List of Hibernate 4 Tutorials...Example code and running projects of Hibernate Criteria Query Here are examples of Criteria Query in Hibernate and all the examples comes with the running 

Hibernate Questions

Hibernate Criteria Query Example
Hibernate Criteria Query Example  Hi, How to create Hibernate Criteria Query Examples in Java program? Share me the easy to learn example code. Thanks   Hi, Hibernate Criteria Query is used to selectively find 

Hibernate-Tutorials

Complete Hibernate 4.0 Tutorial
and fetch data from Java environment to database table. Persistence is a storing ... release You can learn hibernate 4 from our tutorials. Hibernate... from Clause Hibernate where Clause 

Hibernate Questions

hibernate - Hibernate
hibernate  I have written the following program package Hibernate; import org.hibernate.Session; import org.hibernate.*; import..._QUERY ="Select Branches.branch_id from Branches branches"; Query query 

Development process Questions

hibernate - Development process
Hibernate 3.0 core is 68,549 lines of Java code together with 27,948 lines of unit... over a year. Hibernate maps the Java classes to the database tables. It also... in the Java-based middle-tier. Hibernate allows transparent persistence that enables 

Hibernate Questions

hibernate joins
hibernate joins  how to fetch the data from multiple tables in mysql using HQL. Give me one example using joins 

Hibernate Tutorial Example

Hibernate 4
support. Hibernate is popular ORM tool in Java. It can be used with the JPA... to learn Hibernate 4? You can learn Hibernate 4 from our website. We have give many...Hibernate 4 Hibernate 4 is the latest version of Hibernate which was released 

Hibernate Questions

Hibernate required jar files - Hibernate
Hibernate required jar files  Hi, What are the jar files are required for hibernate and Springs application. I want to run complete application springs and hibernate. Where it will be available? How can i use it i.e. 

Hibernate Questions

How to learn Hibernate?
How to learn Hibernate?  I am beginner in Hibernate. Now I want to learn Hibernate. Can anyone explain me how to learn Hibernate from scratch... learn the complete Hibernate. Check the tutorial Hibernate examples and articles 

Hibernate Tutorial Example

Hibernate 4.3 ORM Features
for Stored Procedure: This version of Hibernate provides support for stored...Hibernate 4.3 ORM Features - Learn the new features of Hibernate 4.3 ORM... about the new features of Hibernate 4.3 ORM framework. The Hibernate 4.3 

Hibernate Tutorial Example

Learn Hibernate programming with Examples
In this Hibernate programming tutorial you will learn how to Hibernate ORM programming from... the Hibernate programming from beginning. Here are the tutorials of Hibernate... of Hibernate How to download Hibernate 4 - Tutorial of downloading 

Hibernate Tutorial Example

Hibernate Tutorials
framework. Hibernate takes care of the mapping from Java classes to database tables... Hibernate Query. In this example you will learn how to use the HQL from clause... object/relational persistence and query service for Java. Hibernate lets you 

JEE Technologies

JPA 2.1 Stored Procedure Example
JPA 2.1 Stored Procedure Example - Lear how to call stored procedures from JPA program In this tutorial you will learn how to create Stored Procedure... for programmers. You can easily call stored procedure from your Java 

Hibernate Questions

Java - Hibernate
, this type of output. ---------------------------- Inserting Record Done Hibernate... = null; try{ // This step will read hibernate.cfg.xml and prepare hibernate... of Contact and set values in it by reading them from form object System.out.println 

Hibernate Tutorial Example

Complete Hibernate 3.0 and Hibernate 4 Tutorial
rows from the underlying database using the hibernate. Lets first write a java... object/relational persistence and query service for Java. Hibernate lets you.... Hibernate also allows you to express queries using native SQL or Java-based 

Hibernate Tutorial Example

Hibernate Architecture
Hibernate ORM framework. Hibernate is based on the Java technologies... and delete operations. Hibernate uses the Java classes which represents... diagram shows how Hibernate works: Configuring the Hibernate environment Following 

Hibernate-Tutorials

Hibernate O/R Mapping
and is available as open source project. To use Hibernate with Java you... the data and in respect to an application that how objects are stored...Hibernate O/R Mapping In this tutorial you will learn about the Hibernate O/RM 

Hibernate Interview Questions

HIBERNATE
HIBERNATE   What is difference between Jdbc and Hibernate 

Hibernate Interview Questions

hibernate
hibernate  what is hibernate flow 

Hibernate Questions

hibernate
hibernate  what is hibernate listeners 

Hibernate Tutorial Example

What is Hibernate in Java?
What is Hibernate in Java? Hibernate is an ORM tools for Java. In this section... service for Java. If you will notices on the function of hibernate, it denotes that it helps in persisting data from the database and hibernate creates 

Hibernate Tutorial Example

Hibernate ORM 4.3.1.Final released
. It provides support for Stored procedure, batch updates etc. Bug fixes... for stored procedure is added Now you can execute the UPDATE and DELETE... Hibernate How to use Hibernate 4.3.1 in project? If you are using the Maven 

Hibernate-Tutorials

Dirty Checking In Hibernate
at the time which it is loaded from the database is stored into the memory. In case.... In this example you will see how the hibernate executes the update statement SQL. Here we...Dirty Checking In Hibernate In this section we will read about the dirty 

Hibernate-Tutorials

Hibernate Annotations
Annotations and understand how Hibernate Annotations is simplifying the programming... as Hibernate annotations and it based on the Java 5 annotations. So, to use Hibernate Annotations you should have Java 5 and Hibernate 3 or above. Bothe Hibernate 

Hibernate Questions

hibernate
hibernate  what is hibernate why we use 

Hibernate Questions

Hibernate
Hibernate  hibernate delete query execution 

Hibernate Questions

hibernate
hibernate  please give me the link where i can freely download hibernate software(with dependencies)   Learn hibernate, if you want to learn hibernate, please visit the following link: Hibernate Tutorials 

Hibernate Questions

Hibernate code problem - Hibernate
Hibernate code problem  how to write hibernate Left outer join program 

Hibernate Questions

hibernate code - Hibernate
hibernate code  How to store a image in mysql or oracle db using struts &hibernate 

Hibernate Questions

Hibernate compilation - Hibernate
Hibernate compilation  please explain how to compile and run Hibernate at command prompt ( in dos) with sample example 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles