-->
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: SQL error "Missing IN or OUT parameter at index"
PostPosted: Mon Apr 18, 2005 8:15 am 
Newbie

Joined: Thu Mar 17, 2005 2:00 pm
Posts: 4
Hi all !

We have, from time to time, a strange sql error in a production environnement : Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 1 In this code :

Code:
   
public Book findBook(String code) throws PWRBusinessException {
        try {
            return (Book) session.getNamedQuery("findBookByCode").setString(
                    "code", code).uniqueResult();
        } catch (HibernateException e) {
            throw new PWRBusinessException(e);
        }
    }



The problem occurs even with another setString() like code !

Any idea ?

Thank you !

Yazid

--------------------------------



Hibernate version:

Hibernate 2.1.6

Full stack trace of any exception that occurs:

Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(Ljava.lang.String;Ljava.lang.String;I)V(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(ILjava.lang.Object;)V(DatabaseError.java:162)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(IZ)V(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.clean_temp_clobs()V(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava.sql.ResultSet;(Optimized Method)
at weblogic.jdbc.wrapper.PreparedStatement.executeQuery()Ljava.sql.ResultSet;(Optimized Method)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(Ljava.sql.PreparedStatement;)Ljava.sql.ResultSet;(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Ljava.sql.PreparedStatement;Lnet.sf.hibernate.engine.RowSelection;Lnet.sf.hibernate.engine.SessionImplementor;)Ljava.sql.ResultSet;(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.lang.Object;Ljava.io.Serializable;[Ljava.io.Serializable;Z)Ljava.util.List;(Optimized Method)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.lang.Object;Ljava.io.Serializable;[Ljava.io.Serializable;Z)Ljava.util.List;(Optimized Method)
at net.sf.hibernate.loader.Loader.doList(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.util.Set;[Lnet.sf.hibernate.type.Type;)Ljava.util.List;(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(Ljava.lang.String;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(SessionImpl.java:1544)
at net.sf.hibernate.impl.QueryImpl.list()Ljava.util.List;(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult()Ljava.lang.Object;(AbstractQueryImpl.java:550)
at com.bnpparibas.eqd.power.model.booking.impl.HibernateBookingService.findBook(Ljava.lang.String;)Lcom.bnpparibas.eqd.power.model.booking.Book;(HibernateBookingService.java:40)

Name and version of the database you are using:

Oracle 8.1


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.