Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Java and MS Excel - Really weird

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java and MS Excel - Really weird

    Which of the 113 records is missing, the first or the last? I don't trust the Excel ODBC interface, and you may find the solution will be a hack. I'm thinking, for instance, that the first row may already be in the buffer and next() is not required. That's why inserting a blank record helps. Just a thought.

  • #2
    Java and MS Excel - Really weird

    The first row of the 113 is missing. Are you saying I should try a rs.getXXX before the first rs.next() to get around this? Thanks Tony

    Comment


    • #3
      Java and MS Excel - Really weird

      I've been toying with the POI-HSSF API for the last couple of weeks and it works pretty good. It's an all-Java package that reads/writes the native Excel format. It's one of the Apache-Jakarta sub-projects you can find it at their web site. I think it's apache-jakarta.org or jakrata-apache.org.

      Comment


      • #4
        Java and MS Excel - Really weird

        Yes, I was suggesting to try a getXX without next(), which would be a hack, which is to say I don't trust the JDBC to ODBC bridge. I'd recommend you try what Clifton Craig suggested with the Jakarta POI-HSSF. Apache-Jakarta projects haven't let me down yet.

        Comment


        • #5
          Java and MS Excel - Really weird

          We set up an intranet based application a few months ago that allowed our users to upload files to the 400 and process them. The applications are all built around JSP and Servlets. Most of the apps us AS400FTP for file transfer from the web server, but one of the application reads from an Excel spreadsheet and writes to a physical file on the 400. Normally this spreadsheet comes in with headers and totals. I parse the headers/totals and select the columns I want before writing to the 400. This month for some reason, the spreadsheet came in with no headers or totals. This is not a problem, but for some reason only 112 of the 113 records are written to the 400. The really weird thing is if I manually insert one or two blank rows at the beginning of the spreadsheet all 113 are written to the 400. I've tried positioning the cursor with rs.first, rs.absolute(), and I even read the thing backwards. Maybe someone can take a look at the example class attached and see what I'm doing wrong. Thanks, Tony trichardson@jasusa.com

          TestFileIO.java

          Comment


          • #6
            Java and MS Excel - Really weird

            Thanks guys, I'll give POI-HSSF a try. Tony

            Comment

            Working...
            X