From: Craig Golby <craig.golby@dignitas.ltd.uk>
To: pgsql-jdbc@postgresql.org
Subject: JVM & JDBC Upgrade --- Help !!
Date: Wed, 21 Sep 2011 23:53:25 +0100
Message-ID: <002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: craig.golby@dignitas.ltd.uk
Subject: Re: JVM & JDBC Upgrade --- Help !!
In-Reply-To: <002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk>
References: <002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox