JVM & JDBC Upgrade --- Help !! - Mailing list pgsql-jdbc

From Craig Golby
Subject JVM & JDBC Upgrade --- Help !!
Date
Msg-id 002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk
Whole thread Raw
List pgsql-jdbc

We have a software application (http://www.credability.info) running quite happily on Tomcat 5.5, Java 1.5 and PostgreSQL 8.2.6, using the pg73jdbc3 drivers.

 

Having recently upgraded to Java to 1.6 with no issues, we have now decided to upgrade to Tomcat to v7, but have struggled to get it to work, with issues around SSL & Db Connectivity.  To try and resolve one thing at a time, I have been trying to get my Tomcat 5.5 installation working with the new Drivers so either postgresql-9.1-901.jdbc3, or postgresql-9.1-901.jdbc4.

 

And here it gets a bit strange.  Without wanting to state the obvious, the code used is standardised, and the application loads modules of information to load onto the screen.  When you log onto the secure area, it is obviously making a Db connection to validate your user, and the first couple of screen modules appear.  However it then stops, and in the log files it returns the error ….

 

java.lang.ArrayIndexOutOfBoundsException: 0

 

against a particular Bean.

 

I have compared the working code with what appears to be the broken one, and the key difference is that the first few are simple queries returning single values, whereas this one returns a range of variables and records and we use the ResultSetMetaData characteristics to define the necessary Array to store the result on the fly

 

Code Snippet …

 

    if(conn != null)

    { try

      { pStmt = conn.prepareStatement(stmtStringSel);

        pStmt.clearParameters();

        rsID = pStmt.executeQuery();

 

        //Set up the Array

        ResultSetMetaData rsmd = rsID.getMetaData();

        int columnCount = rsmd.getColumnCount();

        int rowCount = 7;

        rsOpened = new String[rowCount][columnCount];

        int r=0;

        while(rsID.next())

        { int c=0;

          int rsc=1;

          while (rsc <= columnCount)

          { rsOpened[r][c] = rsID.getString(rsc);

            c++;

            rsc++;

          }

          r++;

        }

        pStmt.close();                 

      }catch(SQLException se)  {se.printStackTrace();}

    }

 

Should this still work, and can you suggest anything that might help me narrow down my problem.

 

When I swap my pg73jdbc3 drivers back into place it all works fine.

 

Cheers

 

Craig

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Binary transfer patches v15
Next
From: Craig Ringer
Date:
Subject: Re: JVM & JDBC Upgrade --- Help !!