org.hibernate.exception.GenericJDBCException: could not execute query

Connectivity

org.hibernate.exception.GenericJDBCException: could not execute query

I am getting a weird exception which I have no clue how to fix it. My scenario is:

When I execute following parameterized query using java hibernate(via jdbc driver) everything works great:

StringBuffer hqlStringBuffer = new StringBuffer("from student where name like :Name and class=:Class and section:Section");

 Query query = session.createQuery(hqlStringBuffer.toString());

            query.setString("Name", studname + "%");

            query.setString("Class", class);

            query.setString("Section", section);

 Student student = (Student)query.uniqueResult();

But when I do a bit change it start giving me GenericJDBCException on every third record

StringBuffer hqlStringBuffer = new StringBuffer("from student where (name = :NameAppendF or name= :NameAppendS) and class=:Class and section:Section");

 Query query = session.createQuery(hqlStringBuffer.toString());

            query.setString("NameAppendF", studname + "-F");

            query.setString("NameAppendS", studname + "-S");

            query.setString("Class", class);

            query.setString("Section", section);

 Student student = (Student)query.uniqueResult(); // even if I use list() it does not work

Similar issue if I use In-Clause... I am using terajdbc4.jar. I mean eith it should not work completely or shd work for all. Any quick help will be highly appreciable
3 REPLIES

Re: org.hibernate.exception.GenericJDBCException: could not execute query

more detail exception: [Error 3105] [SQLState HY000] Dispatcher internal error: Please do not re-submit request. 

Teradata Employee

Re: org.hibernate.exception.GenericJDBCException: could not execute query

I think you are missing an equal sign between section and :Section -- it should be:

StringBuffer hqlStringBuffer = new StringBuffer("from student where name like :Name and class=:Class and section=:Section");

Error 3105 is an error from the Teradata Database, and that would be too complicated to troubleshoot in this forum.

After you correct your HQL query, if you still get the Teradata Database Error 3105, and you are a Teradata customer, then you should open an incident with Teradata Customer Support.

Enthusiast

Re: org.hibernate.exception.GenericJDBCException: could not execute query

We're in this problem together,  I'll be opening a ticket w. Teradata Customer Support,  was hoping for a quick hit here.

XenBeven,  I'll be in touch if/when I get some feedback from Teradata Support .   I may need to hit you up for some additional information in the process.

-dave