5 Replies Latest reply on Feb 26, 2002 6:35 AM by susan.lim

    COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets

    miksalmi

      ello

      i'm using JBoss 2.4.3 and DB2 thru IBM "app" driver in db2java.zip. i get "Resultset not scrollable" (CLI0627E) exception when using rs.last() / rs.first in my code. i'm using the same driver without getting any exceptions with WAS4. am i missing some settings or can the resultset be made scrollable in JBoss ? (i have done the usejdbc2.bat thingie)

        • 1. Re: COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets
          davidjencks

          At one time the parameters for what kind of result set you got were ignored: I think this was fixed, but I don't know when. You might look in cvs or try 2.4.4. You probably want to look in PreparedStatementInPool somewhere in jbosspool. (it's in the attic, in 3.0 this stuff is moved to jbosscx).

          • 2. Re: COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets
            thomas_x

            Hi there !
            i want try to use a db2 v. 7.2 with the JBoss2.4.3 but i can't get it running !
            please can you send me your config-file !
            thank'S

            • 3. Re: COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets
              johnnycannuk

              davidjenks
              -you were right, as I was having the same problem with oracle. Turns out the problem wasn't fixed. I submitted a "patch" consisting of a 1 minute cut-paste-edit compile to the XAClientConnection.java in the jbosspool part of the source.(see http://sourceforge.net/tracker/index.php?func=detail&aid=506673&group_id=22866&atid=376687)

              The change is this for those who need to duplicate it/fix their install -

              Fix for #506549 bug scrollable rs prob
              Here is the patch that fixes this:

              The old call to con.prepareStatement(sql,int,int)

              was implemented like this:

              public PreparedStatement prepareStatement(String sql,
              int resultSetType, int resultSetConcurrency) throws
              SQLException {
              return this.prepareStatement(sql);

              }


              it should be like so:

              public PreparedStatement prepareStatement(String sql,
              int resultSetType, int resultSetConcurrency) throws
              SQLException {
              if(con == null) throw new SQLException(CLOSED);
              try {
              return con.prepareStatement(sql,
              resultSetType, resultSetConcurrency);
              } catch(SQLException e) {
              setError(e);
              throw e;
              }

              }


              I have tested this out (although not with the
              testsuite) and it works well - seems like a simple
              oversight considering the implementations of
              prepareStatment() and prepareCall() around it were
              done correctly.

              Mike

              • 4. Re: COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets
                johnnycannuk

                oops forgot to mention that this was for the 2.4.4 final release of jboss (though the bug seems to be present in 2.4.3 as well but).Ironically enough, this seems to have been implemented properly way back in jboss 2.0_FINAL and has since been broken. Has no-one else noticed this or am I the only one using scroll-insensitive resultsets in my beans? Or was it done on purpose and my "fix" breaks something else?

                Mike

                • 5. Re: COM.ibm.db2.jdbc.app.DB2Driver / scrollable resultsets
                  susan.lim

                  Hi,

                  I am also facing the same problem with Oracle DB, Surprisingly, when I switched to mySQL, it worked fine.