aspose file tools
The moose likes Object Relational Mapping and the fly likes Problem in SP Calling using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Problem in SP Calling using Hibernate" Watch "Problem in SP Calling using Hibernate" New topic
Author

Problem in SP Calling using Hibernate

Venkat Raman Parasuraman
Greenhorn

Joined: Oct 13, 2008
Posts: 10
Hi,

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(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2148)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:111)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)
at com.tnt.FastLaneReaderImpl.executeSP(FastLaneReaderImpl.java:41)
at com.tnt.TestSP.main(TestSP.java:13)




Caused by: java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OraclePreparedStatement.setNullInternal(OraclePreparedStatement.java:3662)
at oracle.jdbc.driver.OracleCallableStatement.setNull(OracleCallableStatement.java:4145)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:76)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
at org.hibernate.loader.Loader.bindNamedParameters(Loader.java:1748)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
... 8 more


Thanks,
Venkat
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem in SP Calling using Hibernate
 
Similar Threads
Error in named native query (Invalid Column Name)
[Hibernate3.0] Filters, DB2 => invalid parameter number
problem using hibernate and stored procedures for reading portion of data from database
Hibernate gives PSQLException for polymorphic query on "any"
Calling stored Procedure using hibernate