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

From dmp
Subject Re: JVM & JDBC Upgrade --- Help !!
Date
Msg-id 4E7B4CE9.3030803@ttc-cmc.net
Whole thread Raw
In response to Re: JVM & JDBC Upgrade --- Help !!  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-jdbc
On 09/22/2011 06:53 AM, Craig Golby wrote:
>>
>> 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);
>>

Craig Ringer wrote:
> Is the above line where the exception is thrown from? You didn't provide
> full exception context.
>
> If so, check and make sure the column count reported by `getColumnCount'
> matches what you expect and what the old driver provided. Compare it to
> the table. Compare the column-list metadata output from the old and new
> drivers to see which column(s) have appeared/disappeared.
>
> --
> Craig Ringer

I don't think this coming from the JDBC, your code is throwing the error,
java.lang.ArrayIndexOutOfBoundsException. That rowCount assignment looks
suspicious. The columnCount is coming directly from getColumnCount() so
I don't thinks its the culprit. Put a a system.out in there for r & c to
track.

danap.


pgsql-jdbc by date:

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