Skip to main content

Posts

Showing posts from December, 2011

java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!

I got this exception while executing a HQL query using hibernate template. query is: select * from customer where id = :id and calling find() method. hibernate.find(mysql, new Object[]{123})  If  executing the query like namedQuery or createQuery this will be fine.  Since it is executing directly the query should be like this (? instead of parameter name) select * from customer wher id = ?