Revision 9295 trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/data/DataSourceFactory.java
DataSourceFactory.java | ||
---|---|---|
1791 | 1791 |
* If cannot free internal resources |
1792 | 1792 |
* @throws DriverException |
1793 | 1793 |
* If drivers cannot free remote resources |
1794 |
*/ |
|
1795 |
public void finalize() throws SQLException, DriverException { |
|
1796 |
finalizeThis(); |
|
1797 |
} |
|
1798 |
|
|
1799 |
public void finalizeThis() { |
|
1800 |
try { |
|
1801 |
clearViews(); |
|
1802 |
} catch (Exception e) { |
|
1803 |
e.printStackTrace(); |
|
1804 |
} |
|
1794 |
*/ |
|
1795 |
public void finalizeThis() throws SQLException, DriverException { |
|
1805 | 1796 |
|
1806 |
|
|
1807 | 1797 |
try { |
1808 |
Connection c = java.sql.DriverManager.getConnection( |
|
1809 |
"jdbc:hsqldb:file:", "", ""); |
|
1798 |
clearViews(); |
|
1799 |
} finally { |
|
1800 |
Connection c = null; |
|
1801 |
try { |
|
1802 |
c = java.sql.DriverManager.getConnection( |
|
1803 |
"jdbc:hsqldb:file:", "", ""); |
|
1804 |
} catch (Exception e) { |
|
1805 |
return; |
|
1806 |
} |
|
1810 | 1807 |
Statement st = c.createStatement(); |
1811 | 1808 |
st.execute("SHUTDOWN"); |
1812 | 1809 |
st.close(); |
1813 | 1810 |
c.close(); |
1814 |
} catch (Exception e) { |
|
1815 |
e.printStackTrace(); |
|
1816 | 1811 |
} |
1817 | 1812 |
|
1818 | 1813 |
} |
Also available in: Unified diff