@Override public SqlExceptionHelper getSqlExceptionHelper() { if ( jdbcEnvironment != null ) { return jdbcEnvironment.getSqlExceptionHelper(); } return null; }
public SqlExceptionHelper getSqlExceptionHelper() { return jdbcEnvironment.getSqlExceptionHelper(); }
@Override public DatabaseMetaData getJdbcDatabaseMetaData() { if ( jdbcDatabaseMetaData == null ) { try { jdbcDatabaseMetaData = getJdbcConnection().getMetaData(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC DatabaseMetaData" ); } } return jdbcDatabaseMetaData; }
@Override public DatabaseMetaData getJdbcDatabaseMetaData() { if ( jdbcDatabaseMetaData == null ) { try { jdbcDatabaseMetaData = getJdbcConnection().getMetaData(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC DatabaseMetaData" ); } } return jdbcDatabaseMetaData; }
@Override public Connection getJdbcConnection() { if ( jdbcConnection == null ) { try { jdbcConnection = jdbcConnectionAccess.obtainConnection(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC Connection" ); } } return jdbcConnection; }
protected JDBCException convertSQLException(SQLException sqlException, String message) { return extractionContext.getJdbcEnvironment().getSqlExceptionHelper().convert( sqlException, message ); }
public static DatabaseInformation buildDatabaseInformation( ServiceRegistry serviceRegistry, DdlTransactionIsolator ddlTransactionIsolator, Namespace.Name defaultNamespace) { final JdbcEnvironment jdbcEnvironment = serviceRegistry.getService( JdbcEnvironment.class ); try { return new DatabaseInformationImpl( serviceRegistry, jdbcEnvironment, ddlTransactionIsolator, defaultNamespace ); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to build DatabaseInformation" ); } } }
private void releaseConnection() throws SQLException { if ( connection != null ) { try { serviceRegistry.getService( JdbcEnvironment.class ).getSqlExceptionHelper().logAndClearWarnings( connection ); } finally { try { serviceRegistry.getService( ConnectionProvider.class ).closeConnection( connection ); } finally { connection = null; } } } }
@Override public SqlExceptionHelper getSqlExceptionHelper() { if ( jdbcEnvironment != null ) { return jdbcEnvironment.getSqlExceptionHelper(); } return null; }
@Override public DatabaseMetaData getJdbcDatabaseMetaData() { if ( jdbcDatabaseMetaData == null ) { try { jdbcDatabaseMetaData = getJdbcConnection().getMetaData(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC DatabaseMetaData" ); } } return jdbcDatabaseMetaData; }
@Override public DatabaseMetaData getJdbcDatabaseMetaData() { if ( jdbcDatabaseMetaData == null ) { try { jdbcDatabaseMetaData = getJdbcConnection().getMetaData(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC DatabaseMetaData" ); } } return jdbcDatabaseMetaData; }
@Override public Connection getJdbcConnection() { if ( jdbcConnection == null ) { try { jdbcConnection = jdbcConnectionAccess.obtainConnection(); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to obtain JDBC Connection" ); } } return jdbcConnection; }
protected JDBCException convertSQLException(SQLException sqlException, String message) { return extractionContext.getJdbcEnvironment().getSqlExceptionHelper().convert( sqlException, message ); }
default int getColumnCount() { try { return getResultSet().getMetaData().getColumnCount(); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to access ResultSet column count" ); } }
public static DatabaseInformation buildDatabaseInformation( ServiceRegistry serviceRegistry, DdlTransactionIsolator ddlTransactionIsolator, Namespace defaultNamespace) { final JdbcEnvironment jdbcEnvironment = serviceRegistry.getService( JdbcEnvironment.class ); try { return new DatabaseInformationImpl( serviceRegistry, jdbcEnvironment, ddlTransactionIsolator, defaultNamespace ); } catch (SQLException e) { throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to build DatabaseInformation" ); } }
@Override public int getColumnCount() { try { return getMetaData().getColumnCount(); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to access ResultSet column count" ); } }
@Override public int resolveColumnPosition(String columnName) { try { return getResultSet().findColumn( columnName ); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to find column position by name" ); } }
default int resolveColumnPosition(String columnName) { try { return getResultSet().findColumn( columnName ); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to find column position by name" ); } }
default String resolveColumnName(int position) { try { return getFactory().getJdbcServices(). getJdbcEnvironment() .getDialect() .getColumnAliasExtractor() .extractColumnAlias( getResultSet().getMetaData(), position ); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to find column name by position" ); } }
@Override public String resolveColumnName(int position) { try { return getFactory().getJdbcServices(). getJdbcEnvironment() .getDialect() .getColumnAliasExtractor() .extractColumnAlias( getMetaData(), position ); } catch (SQLException e) { throw getFactory().getJdbcServices().getJdbcEnvironment().getSqlExceptionHelper().convert( e, "Unable to find column name by position" ); } }