Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7C10BB5DC15 for ; Wed, 21 Sep 2011 22:41:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 43626-09 for ; Thu, 22 Sep 2011 01:41:27 +0000 (UTC) X-Greylist: delayed 02:47:54.743226 by SQLgrey-1.8.0-rc2 Received: from smtp-out2.electric.net (smtp-out2.electric.net [72.35.23.31]) by mail.postgresql.org (Postfix) with ESMTP id C6815B5DC1A for ; Wed, 21 Sep 2011 22:41:26 -0300 (ADT) Received: from 1R6VfT-0006dT-Ux by worden.electric.net with emc1-ok (Exim 4.76) (envelope-from ) id 1R6VfU-0006e0-V5 for pgsql-jdbc@postgresql.org; Wed, 21 Sep 2011 15:53:28 -0700 Received: by emcmailer; Wed, 21 Sep 2011 15:53:28 -0700 Received: from [10.86.5.46] (helo=fuse246.electric.net) by worden.electric.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1R6VfT-0006dT-Ux for pgsql-jdbc@postgresql.org; Wed, 21 Sep 2011 15:53:28 -0700 Received: from mailanyone.net by fuse246.electric.net with esmtpa (MailAnyone extSMTP gocraig) id 1R6VfQ-0007MD-9T for pgsql-jdbc@postgresql.org; Wed, 21 Sep 2011 15:53:27 -0700 Reply-To: From: "Craig Golby" To: Subject: JVM & JDBC Upgrade --- Help !! Date: Wed, 21 Sep 2011 23:53:25 +0100 Message-ID: <002201cc78b1$46393300$d2ab9900$@golby@dignitas.ltd.uk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0023_01CC78B9.A7FD9B00" X-Mailer: Microsoft Office Outlook 12.0 thread-index: Acx4sUVLhYBrjat0QU+ZewL5VBeaCA== Content-Language: en-gb X-Outbound-IP: 10.86.5.46 X-Env-From: craig.golby@dignitas.ltd.uk X-PolicySMART: 1046319 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, MSGID_MULTIPLE_AT=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201109/84 X-Sequence-Number: 22202 This is a multi-part message in MIME format. ------=_NextPart_000_0023_01CC78B9.A7FD9B00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0023_01CC78B9.A7FD9B00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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 !=3D = null)

    { try

      { pStmt =3D = conn.prepareStatement(stmtStringSel);

        = pStmt.clearParameters();

        rsID =3D = pStmt.executeQuery();

 

        //Set up = the Array

        = ResultSetMetaData rsmd =3D rsID.getMetaData();

        int = columnCount =3D rsmd.getColumnCount();

        int = rowCount =3D 7;

        rsOpened = =3D new String[rowCount][columnCount];

        int = r=3D0;

        = while(rsID.next())

        { int = c=3D0;

          = int rsc=3D1;

          = while (rsc <=3D columnCount)

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

         &= nbsp;  c++;

         &= nbsp;  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

------=_NextPart_000_0023_01CC78B9.A7FD9B00--