@Deprecated public static void closeQuietly(Connection connection) { Common.closeQuietly(connection); }
@Deprecated public static void closeQuietly(Statement statement) { Common.closeQuietly(statement); }
@Deprecated public static void closeQuietly(ResultSet resultSet) { Common.closeQuietly(resultSet); }
@Deprecated public static void closeQuietly(Connection connection) { Common.closeQuietly(connection); }
@Deprecated public static void closeQuietly(ResultSet resultSet) { Common.closeQuietly(resultSet); }
@Deprecated public static void closeQuietly(Statement statement) { Common.closeQuietly(statement); }
@Override public void dispose() { Connection conn = null; try { conn = DriverManager.getConnection(uri + ";shutdown=true"); } catch (SQLException e) { // ignored } finally { closeQuietly(conn); } super.dispose(); } }
@Override public void dispose() { Connection conn = null; try { conn = DriverManager.getConnection(uri + ";shutdown=true"); } catch (SQLException e) { // ignored } finally { closeQuietly(conn); } super.dispose(); } }
protected void loadQuoteString() { Connection conn = null; try { conn = dataSource.getConnection(); if (conn == null) { throw new IllegalStateException("Could not get connection to load quote String"); } quoteRef.set(conn.getMetaData().getIdentifierQuoteString().trim()); } catch (SQLException e) { throw new RuntimeException("Unable to query the database", e); } finally { closeQuietly(conn); } }
protected void loadQuoteString() { Connection conn = null; try { conn = dataSource.getConnection(); if (conn == null) { throw new IllegalStateException("Could not get connection to load quote String"); } quoteRef.set(conn.getMetaData().getIdentifierQuoteString().trim()); } catch (SQLException e) { throw new RuntimeException("Unable to query the database", e); } finally { closeQuietly(conn); } }
protected boolean hasIndex(String tableName, String indexName) { Connection connection = null; try { connection = getConnection(); ResultSet indexes = getIndexes(connection, tableName); while (indexes.next()) { if (indexName.equalsIgnoreCase(indexes.getString("INDEX_NAME"))) { return true; } } return false; } catch (SQLException e) { throw new ActiveObjectsException(e); } finally { closeQuietly(connection); } }
private String findUniqueIndex(String table, String field, boolean returnPrimary) { Connection connection = null; try { connection = getConnection(); ResultSet indexes = getIndexes(connection, table); while (indexes.next()) { if (field.equalsIgnoreCase(indexes.getString("COLUMN_NAME"))) { String name = indexes.getString("INDEX_NAME"); if (returnPrimary == name.contains("PRIMARY")) { return indexes.getString("INDEX_NAME"); } } } return null; } catch (SQLException e) { throw new ActiveObjectsException(e); } finally { closeQuietly(connection); } }
private String findUniqueIndex(String table, String field, boolean returnPrimary) { Connection connection = null; try { connection = getConnection(); ResultSet indexes = getIndexes(connection, table); while (indexes.next()) { if (field.equalsIgnoreCase(indexes.getString("COLUMN_NAME"))) { String name = indexes.getString("INDEX_NAME"); if (returnPrimary == name.contains("PRIMARY")) { return indexes.getString("INDEX_NAME"); } } } return null; } catch (SQLException e) { throw new ActiveObjectsException(e); } finally { closeQuietly(connection); } }
protected boolean hasIndex(String tableName, String indexName) { Connection connection = null; try { connection = getConnection(); ResultSet indexes = getIndexes(connection, tableName); while (indexes.next()) { if (indexName.equalsIgnoreCase(indexes.getString("INDEX_NAME"))) { return true; } } return false; } catch (SQLException e) { throw new ActiveObjectsException(e); } finally { closeQuietly(connection); } }