public abstract class AbstractDriverBasedDataSource extends AbstractDataSource
Driver
SE で動作する JDBC DataSource
SE 実装の抽象基本クラス。SimpleDriverDataSource
, DriverManagerDataSource
logger
コンストラクターと説明 |
---|
AbstractDriverBasedDataSource() |
修飾子と型 | メソッドと説明 |
---|---|
StringSE | getCatalog() 各 Connection に適用されるデータベースカタログがあれば、それを返します。 |
ConnectionSE | getConnection() この実装は、この DataSource のデフォルトのユーザー名とパスワードを使用して getConnectionFromDriver に委譲します。 |
ConnectionSE | getConnection(StringSE username, StringSE password) この実装は、指定されたユーザー名とパスワードを使用して getConnectionFromDriver に委譲します。 |
protected abstract ConnectionSE | getConnectionFromDriver(PropertiesSE props) 指定されたプロパティを使用して接続を取得します。 |
protected ConnectionSE | getConnectionFromDriver(StringSE username, StringSE password) 指定されたユーザー名とパスワード(存在する場合)を含むドライバーのプロパティを構築し、対応する接続を取得します。 |
PropertiesSE | getConnectionProperties() ドライバーに渡される接続プロパティがあれば、それを返します。 |
StringSE | getPassword() ドライバーを介した接続に使用する JDBC パスワードを返します。 |
StringSE | getSchema() 各接続に適用されるデータベーススキーマがあれば、それを返します。 |
StringSE | getUrl() ドライバーを介した接続に使用する JDBC URL を返します。 |
StringSE | getUsername() ドライバーを介した接続に使用する JDBC ユーザー名を返します。 |
void | setCatalog(StringSE catalog) 各接続に適用されるデータベースカタログを指定します。 |
void | setConnectionProperties(PropertiesSE connectionProperties) 任意の接続プロパティをキー / 値のペアとして指定し、ドライバーに渡します。 |
void | setPassword(StringSE password) ドライバーを介した接続に使用する JDBC パスワードを設定します。 |
void | setSchema(StringSE schema) 各接続に適用されるデータベーススキーマを指定します。 |
void | setUrl(StringSE url) ドライバーを介した接続に使用する JDBC URL を設定します。 |
void | setUsername(StringSE username) ドライバーを介した接続に使用する JDBC ユーザー名を設定します。 |
getLoginTimeout, getLogWriter, getParentLogger, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public void setCatalog(@Nullable StringSE catalog)
Connection.setCatalog(java.lang.String)
SE@Nullable public StringSE getCatalog()
public void setSchema(@Nullable StringSE schema)
Connection.setSchema(java.lang.String)
SEpublic void setConnectionProperties(@Nullable PropertiesSE connectionProperties)
"user" および "password" プロパティを含めることもできます。ただし、この DataSource で指定された "username" および "password" Bean プロパティは、対応する接続プロパティをオーバーライドします。
@Nullable public PropertiesSE getConnectionProperties()
public ConnectionSE getConnection() throws SQLExceptionSE
getConnectionFromDriver
に委譲します。public ConnectionSE getConnection(StringSE username, StringSE password) throws SQLExceptionSE
getConnectionFromDriver
に委譲します。protected ConnectionSE getConnectionFromDriver(@Nullable StringSE username, @Nullable StringSE password) throws SQLExceptionSE
username
- ユーザーの名前 password
- 使用するパスワード SQLExceptionSE
- 失敗した場合 Driver.connect(String, java.util.Properties)
SEprotected abstract ConnectionSE getConnectionFromDriver(PropertiesSE props) throws SQLExceptionSE
サブクラスによって実装されるテンプレートメソッド。
props
- 結合された接続プロパティ SQLExceptionSE
- 失敗した場合