db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Re: Problem with a derby database - connection closed and ArrayIndexOutOfBoundsExeption
Date Sat, 01 Oct 2011 13:09:16 GMT
On 9/30/2011 8:24 AM, rob wrote:
> Sorry here are the full stacktrace:
Rob, I think you should go ahead and file a bug for this and work on a 
reproduction that you can attach to the issue.
http://db.apache.org/derby/DerbyBugGuidelines.html

Please make sure you include the exact 10.5 version you are upgrading from.

Things to try:
1)    See if a stand alone java program which just runs getIndexInfo() 
runs against the upgraded database pops the issue.

2) If that reproduces the problem and you can't share your database, ry 
creating one at the problematic 10.5 version, run getIndexInfo on that, 
upgrade to 10.8 and then run getIndexInfo against that.

Below is a small  Embedded template program that you can modify when 
trying to get a reproduction.  Just add a call to 
conn.getMetaData().getIndexInfo

Thanks

Kathey

import java.sql.*;
import java.net.*;
import java.io.*;


public class  EmbeddedTemplate {

     public static void main(String[] args) throws Exception{
     try {
         Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
         Connection conn = 
DriverManager.getConnection("jdbc:derby:wombat;create=true");
         // clean up from a previous run
         Statement s = conn.createStatement();
         try {
         s.executeUpdate("DROP TABLE T");
         } catch (SQLException se) {
         if (!se.getSQLState().equals("42Y55"))
             throw se;
         }
         // Do something with the database.
         // Add a couple rows to a  table and select
         s.executeUpdate("CREATE TABLE T (I INT, C CLOB(1M))");
         PreparedStatement ps = conn.prepareStatement("INSERT INTO T 
VALUES(?,?)");
         ps.setInt(1,1);
         ps.setString(2,"Hello");
         ps.executeUpdate();
         ps.setInt(1,2);
         ps.setString(2,"Goodbye");
         ps.executeUpdate();
         ResultSet rs = s.executeQuery("SELECT * FROM T");
         System.out.println("--- RESULTS SELECT * FROM T ---");
         while (rs.next()) {
         System.out.println(rs.getInt(1) + "," + rs.getString(2));
         }
         rs.close();
         ps.close();
         s.close();
         conn.close();
     } catch (SQLException se) {
         while (se != null) {
         System.out.println("SQLState=" + se.getSQLState() + 
se.getMessage());
         se.printStackTrace();
         se = se.getNextException();
         }
     }
     }

}



Mime
View raw message