/** * Simply delegates to {@link #doGetConnection(String, String)}, * keeping the given user credentials as-is. */ @Override public Connection getConnection(String username, String password) throws SQLException { return doGetConnection(username, password); }
/** * Determine whether there are currently thread-bound credentials, * using them if available, falling back to the statically specified * username and password (i.e. values of the bean properties) otherwise. * <p>Delegates to {@link #doGetConnection(String, String)} with the * determined credentials as parameters. * @see #doGetConnection */ @Override public Connection getConnection() throws SQLException { JdbcUserCredentials threadCredentials = this.threadBoundCredentials.get(); Connection con = (threadCredentials != null ? doGetConnection(threadCredentials.username, threadCredentials.password) : doGetConnection(this.username, this.password)); if (this.catalog != null) { con.setCatalog(this.catalog); } if (this.schema != null) { con.setSchema(this.schema); } return con; }
/** * Applies the current isolation level value and read-only flag * to the returned Connection. * @see #getCurrentIsolationLevel() * @see #getCurrentReadOnlyFlag() */ @Override protected Connection doGetConnection(@Nullable String username, @Nullable String password) throws SQLException { Connection con = super.doGetConnection(username, password); Boolean readOnlyToUse = getCurrentReadOnlyFlag(); if (readOnlyToUse != null) { con.setReadOnly(readOnlyToUse); } Integer isolationLevelToUse = getCurrentIsolationLevel(); if (isolationLevelToUse != null) { con.setTransactionIsolation(isolationLevelToUse); } return con; }
/** * Simply delegates to {@link #doGetConnection(String, String)}, * keeping the given user credentials as-is. */ @Override public Connection getConnection(String username, String password) throws SQLException { return doGetConnection(username, password); }
/** * Simply delegates to {@link #doGetConnection(String, String)}, * keeping the given user credentials as-is. */ @Override public Connection getConnection(String username, String password) throws SQLException { return doGetConnection(username, password); }
/** * Determine whether there are currently thread-bound credentials, * using them if available, falling back to the statically specified * username and password (i.e. values of the bean properties) else. * <p>Delegates to {@link #doGetConnection(String, String)} with the * determined credentials as parameters. */ @Override public Connection getConnection() throws SQLException { JdbcUserCredentials threadCredentials = this.threadBoundCredentials.get(); if (threadCredentials != null) { return doGetConnection(threadCredentials.username, threadCredentials.password); } else { return doGetConnection(this.username, this.password); } }
/** * Determine whether there are currently thread-bound credentials, * using them if available, falling back to the statically specified * username and password (i.e. values of the bean properties) otherwise. * <p>Delegates to {@link #doGetConnection(String, String)} with the * determined credentials as parameters. * @see #doGetConnection */ @Override public Connection getConnection() throws SQLException { JdbcUserCredentials threadCredentials = this.threadBoundCredentials.get(); Connection con = (threadCredentials != null ? doGetConnection(threadCredentials.username, threadCredentials.password) : doGetConnection(this.username, this.password)); if (this.catalog != null) { con.setCatalog(this.catalog); } if (this.schema != null) { con.setSchema(this.schema); } return con; }
/** * Applies the current isolation level value and read-only flag * to the returned Connection. * @see #getCurrentIsolationLevel() * @see #getCurrentReadOnlyFlag() */ @Override protected Connection doGetConnection(@Nullable String username, @Nullable String password) throws SQLException { Connection con = super.doGetConnection(username, password); Boolean readOnlyToUse = getCurrentReadOnlyFlag(); if (readOnlyToUse != null) { con.setReadOnly(readOnlyToUse); } Integer isolationLevelToUse = getCurrentIsolationLevel(); if (isolationLevelToUse != null) { con.setTransactionIsolation(isolationLevelToUse); } return con; }
/** * Applies the current isolation level value and read-only flag * to the returned Connection. * @see #getCurrentIsolationLevel() * @see #getCurrentReadOnlyFlag() */ @Override protected Connection doGetConnection(String username, String password) throws SQLException { Connection con = super.doGetConnection(username, password); Boolean readOnlyToUse = getCurrentReadOnlyFlag(); if (readOnlyToUse != null) { con.setReadOnly(readOnlyToUse); } Integer isolationLevelToUse = getCurrentIsolationLevel(); if (isolationLevelToUse != null) { con.setTransactionIsolation(isolationLevelToUse); } return con; }