File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Problem in SP Calling using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem in SP Calling using Hibernate" Watch "Problem in SP Calling using Hibernate" New topic

Problem in SP Calling using Hibernate

Venkat Raman Parasuraman

Joined: Oct 13, 2008
Posts: 10

Kindly give suggestion for the below error.

Iam calling a stored function using Hibernate. My calling always throws invalid column index. But the same is executed in SQL Delveloper. Please find the HBM entry below.

I am setting the parameters for the above query. I get the below exception...

Hibernate: {
CALL TEP00001.Execute001 (?, ?,?,?,?,?,?)
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(
at org.hibernate.exception.SQLStateConverter.convert(
at org.hibernate.exception.JDBCExceptionHelper.convert(
at org.hibernate.loader.Loader.doList(
at org.hibernate.loader.Loader.listIgnoreQueryCache(
at org.hibernate.loader.Loader.list(
at org.hibernate.loader.custom.CustomLoader.list(
at org.hibernate.impl.SessionImpl.listCustomQuery(
at org.hibernate.impl.AbstractSessionImpl.list(
at org.hibernate.impl.SQLQueryImpl.list(
at com.tnt.FastLaneReaderImpl.executeSP(
at com.tnt.TestSP.main(

Caused by: java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.OraclePreparedStatement.setNullInternal(
at oracle.jdbc.driver.OracleCallableStatement.setNull(
at org.hibernate.type.NullableType.nullSafeSet(
at org.hibernate.type.NullableType.nullSafeSet(
at org.hibernate.loader.Loader.bindNamedParameters(
at org.hibernate.loader.Loader.prepareQueryStatement(
at org.hibernate.loader.Loader.doQuery(
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(
at org.hibernate.loader.Loader.doList(
... 8 more

jQuery in Action, 3rd edition
subject: Problem in SP Calling using Hibernate
It's not a secret anymore!