/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Remove a session id from the table. * * @param id * @throws SQLException */ private void delete (String id) throws SQLException { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_deleteId)) { connection.setAutoCommit(true); statement.setString(1, id); statement.executeUpdate(); } }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Remove a session id from the table. * * @param id * @throws SQLException */ private void delete (String id) throws SQLException { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_deleteId)) { connection.setAutoCommit(true); statement.setString(1, id); statement.executeUpdate(); } }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Get a connection from the driver. * @return * @throws SQLException */ private Connection getConnection () throws SQLException { return ((JDBCSessionIdManager)getSessionIdManager()).getConnection(); }
/** * Check if a session id exists. * * @param id * @return * @throws SQLException */ private boolean exists (String id) throws SQLException { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_queryId)) { connection.setAutoCommit(true); statement.setString(1, id); try (ResultSet result = statement.executeQuery()) { return result.next(); } } }
/** * Remove a session id from the table. * * @param id * @throws SQLException */ private void delete (String id) throws SQLException { Connection connection = null; try { connection = getConnection(); connection.setAutoCommit(true); PreparedStatement statement = connection.prepareStatement(_deleteId); statement.setString(1, id); statement.executeUpdate(); } finally { if (connection != null) connection.close(); } }
/** * Remove a session id from the table. * * @param id * @throws SQLException */ private void delete (String id) throws SQLException { Connection connection = null; try { connection = getConnection(); connection.setAutoCommit(true); PreparedStatement statement = connection.prepareStatement(_deleteId); statement.setString(1, id); statement.executeUpdate(); } finally { if (connection != null) connection.close(); } }
/** * Check if a session id exists. * * @param id * @return * @throws SQLException */ private boolean exists (String id) throws SQLException { try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(_queryId)) { connection.setAutoCommit(true); statement.setString(1, id); try (ResultSet result = statement.executeQuery()) { return result.next(); } } }
/** * Check if a session id exists. * * @param id * @return * @throws SQLException */ private boolean exists (String id) throws SQLException { Connection connection = null; try { connection = getConnection(); connection.setAutoCommit(true); PreparedStatement statement = connection.prepareStatement(_queryId); statement.setString(1, id); ResultSet result = statement.executeQuery(); return result.next(); } finally { if (connection != null) connection.close(); } }
/** * Check if a session id exists. * * @param id * @return * @throws SQLException */ private boolean exists (String id) throws SQLException { Connection connection = null; try { connection = getConnection(); connection.setAutoCommit(true); PreparedStatement statement = connection.prepareStatement(_queryId); statement.setString(1, id); ResultSet result = statement.executeQuery(); return result.next(); } finally { if (connection != null) connection.close(); } }
/** * Remove a session id from the table. * * @param id * @throws SQLException */ private void delete (String id) throws SQLException { Connection connection = null; try { connection = getConnection(); connection.setAutoCommit(true); PreparedStatement statement = connection.prepareStatement(_deleteId); statement.setString(1, id); statement.executeUpdate(); } finally { if (connection != null) connection.close(); } }
/** * Insert a new used session id into the table. * * @param id * @throws SQLException */ private void insert (String id) throws SQLException { try (Connection connection = getConnection(); PreparedStatement query = connection.prepareStatement(_queryId)) { connection.setAutoCommit(true); query.setString(1, id); try (ResultSet result = query.executeQuery()) { //only insert the id if it isn't in the db already if (!result.next()) { try (PreparedStatement statement = connection.prepareStatement(_insertId)) { statement.setString(1, id); statement.executeUpdate(); } } } } }
try connection = getConnection(); connection.setAutoCommit(true); statement = connection.prepareStatement(_deleteId);