You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2013/07/10 19:31:29 UTC
svn commit: r1501867 - in /db/derby/code/branches/10.8: ./
java/tools/org/apache/derby/impl/tools/ij/ij.jj
Author: kmarsden
Date: Wed Jul 10 17:31:28 2013
New Revision: 1501867
URL: http://svn.apache.org/r1501867
Log:
DERBY-5163 [patch] fix up sql cleanup handling
Contributed by Dave Brosius.
Merged 1098040 from trunk to 10.8
Modified:
db/derby/code/branches/10.8/ (props changed)
db/derby/code/branches/10.8/java/tools/org/apache/derby/impl/tools/ij/ij.jj
Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1098040
Modified: db/derby/code/branches/10.8/java/tools/org/apache/derby/impl/tools/ij/ij.jj
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/tools/org/apache/derby/impl/tools/ij/ij.jj?rev=1501867&r1=1501866&r2=1501867&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/tools/org/apache/derby/impl/tools/ij/ij.jj (original)
+++ db/derby/code/branches/10.8/java/tools/org/apache/derby/impl/tools/ij/ij.jj Wed Jul 10 17:31:28 2013
@@ -403,8 +403,11 @@ class ij {
return new ijStatementResult(aStatement,true);
} catch (SQLException e) {
+ try {
if (aStatement!=null) // free the resource
aStatement.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -638,10 +641,13 @@ class ij {
if(!rs.next())
throw ijException.noSuchTable(table);
} finally {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException e) {
}
}
+ }
/**
Return a resultset of tables (or views, procs...) in the given schema.
@@ -672,8 +678,11 @@ class ij {
return new ijResultSetResult(rs, displayColumns, columnWidths);
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -687,21 +696,12 @@ class ij {
private ResultSet getIndexInfoForTable(String schema, String table)
throws SQLException {
- ResultSet rs = null;
- try {
haveConnection();
verifyTableExists(schema, table);
DatabaseMetaData dbmd = theConnection.getMetaData();
- rs = dbmd.getIndexInfo(null, schema, table, false, true);
-
- } catch (SQLException e) {
- if(rs!=null)
- rs.close();
- throw e;
+ return dbmd.getIndexInfo(null, schema, table, false, true);
}
- return rs;
- }
/**
* Used by showIndexes to get columns in correct order
@@ -802,8 +802,11 @@ class ij {
}
return result;
} catch (SQLException e) {
+ try {
if(result!=null)
result.closeStatement();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -832,8 +835,11 @@ class ij {
return new ijResultSetResult(rs, displayColumns, columnWidths);
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -894,8 +900,11 @@ class ij {
return new ijResultSetResult(rs, displayColumns, columnWidths);
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -920,8 +929,11 @@ class ij {
return new ijResultSetResult(rs, displayColumns, columnWidths);
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -957,8 +969,11 @@ class ij {
theConnection.getMetaData().getDriverName());
}
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -994,8 +1009,11 @@ class ij {
theConnection.getMetaData().getDriverName());
}
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -1041,8 +1059,11 @@ class ij {
theConnection.getMetaData().getDriverName());
}
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -1101,8 +1122,11 @@ class ij {
return new ijResultSetResult(rs, displayColumns, columnWidths);
} catch (SQLException e) {
+ try {
if(rs!=null)
rs.close();
+ } catch (SQLException se) {
+ }
throw e;
}
}
@@ -2239,8 +2263,14 @@ throws SQLException
sn.addCursorStatement(qi.getLocalName(),st);
sn.addCursor(qi.getLocalName(),rs);
} catch (SQLException e) {
+ try {
if (rs!=null) rs.close();
+ } catch (SQLException se) {
+ }
+ try {
if (st!=null) st.close();
+ } catch (SQLException se) {
+ }
throw e;
}