JVM & JDBC Upgrade --- Help !!

From: "Craig Golby" <craig(dot)golby(at)dignitas(dot)ltd(dot)uk>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: JVM & JDBC Upgrade --- Help !!
Date: 2011-09-21 22:53:25
Message-ID: 002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2011-09-22 04:25:48 Re: JVM & JDBC Upgrade --- Help !!
Previous Message Dave Cramer 2011-09-21 22:44:24 Re: Binary transfer patches v15