× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dave,
I imported the JTOpen 3.0 into Eclipse and the getRowCount() now returns the
right number of rows. Now I keep getting the "Cursor State not valid error."

Let me go dig through and see what I am doing wrong now.


-----Original Message-----
From: Dave Wall [mailto:dawall@us.ibm.com]
Sent: Tuesday, May 21, 2002 6:06 PM
To: java400-l@midrange.com
Subject: RE: Custom Table Model.


You will have to import JTOpen 3.0 into VAJ.  VAJ will display errors when
importing because JTOpen 3.0 has support for JDBC 3.0.  VAJ will complain
when you import because it won't be able to find classes to resolve
references to the JDBC 3.0 classes.

I have one alternative.  You could do something like

// initialize rowCount to be -1
public int getRowCount()
{
   if (rowCount < 0)
   try
   {
      getResultSet().beforeFirst();
      rowCount = 0;
      while (getResultSet().next())
         rowCount++;
   }
   return rowCount;
}

That is, cycle through the rows until you run out, then return the count.
You don't seem to worry about preserving the cursor position in this method
so this should work.

I suggest this only because putting a new version of Toolbox in ET400 can
be painful.  VAJ is a great tool, but it is not very flexible.  If VAJ
doesn't like something (like missing references) it can be a pain about
letting you move forward.  If you do something like the above you should
switch back to doing getRow() when you can easily move up to JTOpen 3.0.

David Wall
Toolbox for Java
iSeries ODBC Driver for Linux




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.