java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc. PreparedStatement_base. executeQuery(PreparedStatement_base.java:214)

jtds | alf239 | 1 decade ago
  1. 0

    "ResultSet expected" problem

    jtds | 1 decade ago | alf239
    java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc. PreparedStatement_base. executeQuery(PreparedStatement_base.java:214)
  2. 0

    Exception with Sybase and metaData.getTables()

    jtds | 1 decade ago | mrezaei
    java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(PreparedStatement_base.java:264) at net.sourceforge.jtds.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:1676)
  3. 0

    I've found one problem with EntityPersister: when it tries to insert entity via jTDS drivers, there is exception thrown: 127174 [DEBUG] HibernateSession - insert(Log[@DOMORESPORTS/Club/Groups-Service Granted]) Hibernate: insert into span.span.Logs (Username, ClientID, [Date], [Time], Status, Core, Action1, Action2, Action3) values (?, ?, ?, ?, ?, ?, ?, ?, ?) select SCOPE_IDENTITY() 127391 [WARN ] JDBCExceptionReporter - SQL Error: 0, SQLState: null 127392 [ERROR] JDBCExceptionReporter - Was expecting a result set 127724 [WARN ] JDBCExceptionReporter - SQL Error: 0, SQLState: null 127968 [ERROR] JDBCExceptionReporter - Was expecting a result set 127983 [ERROR] JDBCExceptionReporter - could not insert: [com.dataart.newham.util.LogRecord] java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(PreparedStatement_base.java:203) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:508) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432) The problem is in executeQuery() method: you should not use this method on complex statements, because they produce more than one result. I've fixed it, diff file for EntityPersister attached. There's workaround for this problem: it is enough to override public String appendIdentitySelectToInsert(String insertSQL) and return null. But I hope my solution is a bit more usable one. 508c494,497 < return getGeneratedIdentity( object, session, insertSelect.executeQuery() ); --- > insertSelect.execute(); > while (insertSelect.getResultSet() == null) > insertSelect.getMoreResults(); > return getGeneratedIdentity( object, session, insertSelect.getResultSet() ); 519d507 <

    Hibernate JIRA | 1 decade ago | Alexey Filippov
    java.sql.SQLException: Was expecting a result set
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I've found one problem with EntityPersister: when it tries to insert entity via jTDS drivers, there is exception thrown: 127174 [DEBUG] HibernateSession - insert(Log[@DOMORESPORTS/Club/Groups-Service Granted]) Hibernate: insert into span.span.Logs (Username, ClientID, [Date], [Time], Status, Core, Action1, Action2, Action3) values (?, ?, ?, ?, ?, ?, ?, ?, ?) select SCOPE_IDENTITY() 127391 [WARN ] JDBCExceptionReporter - SQL Error: 0, SQLState: null 127392 [ERROR] JDBCExceptionReporter - Was expecting a result set 127724 [WARN ] JDBCExceptionReporter - SQL Error: 0, SQLState: null 127968 [ERROR] JDBCExceptionReporter - Was expecting a result set 127983 [ERROR] JDBCExceptionReporter - could not insert: [com.dataart.newham.util.LogRecord] java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(PreparedStatement_base.java:203) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:508) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432) The problem is in executeQuery() method: you should not use this method on complex statements, because they produce more than one result. I've fixed it, diff file for EntityPersister attached. There's workaround for this problem: it is enough to override public String appendIdentitySelectToInsert(String insertSQL) and return null. But I hope my solution is a bit more usable one. 508c494,497 < return getGeneratedIdentity( object, session, insertSelect.executeQuery() ); --- > insertSelect.execute(); > while (insertSelect.getResultSet() == null) > insertSelect.getMoreResults(); > return getGeneratedIdentity( object, session, insertSelect.getResultSet() ); 519d507 <

    Hibernate JIRA | 1 decade ago | Alexey Filippov
    java.sql.SQLException: Was expecting a result set
  6. 0

    can log in... can not add any users!

    oreports | 1 decade ago | kraulin
    java.sql.SQLException: Was expecting a result set at net.sourceforge.jtds.jdbc.PreparedStatement\_base.executeQuery(Unknown Source)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      Was expecting a result set at net.sourceforge.jtds.jdbc. PreparedStatement_base. executeQuery(PreparedStatement_base.java:214)

      at TestJtds.main()
    2. Unknown
      TestJtds.main
      1. TestJtds.main(TestJtds.java:17)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames