|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.doma.jdbc.SimpleDataSource
public class SimpleDataSource
DriverManager.getConnection(String, Properties)を使用して
Connection を返す単純なデータソースです。
ごく単純なアプリケーションやサンプルプログラムで使用されることを想定しています。 通常は、JTAトランザクションと連携する
実装やコネクションプーリングを提供する DataSource の実装を使用してください。
| フィールドの概要 | |
|---|---|
protected String |
password
データベースの接続パスワードです。 |
protected Properties |
properties
JDBCドライバへのプロパティです。 |
protected static String |
UNABLE_TO_ESTABLISH_CONNECTION
コネクションが確立できない場合の SQLState コードです。 |
protected String |
url
jdbc:subprotocol:subnameという形式のデータベースへの接続URLです。 |
protected String |
user
データベースの接続ユーザーです。 |
| コンストラクタの概要 | |
|---|---|
SimpleDataSource()
|
|
| メソッドの概要 | ||
|---|---|---|
void |
addProperty(String key,
String value)
JDBCドライバへのプロパティを追加します。 |
|
Connection |
getConnection()
|
|
Connection |
getConnection(String user,
String password)
|
|
protected Connection |
getConnectionInternal(Properties info)
内部的にコネクションを返します。 |
|
int |
getLoginTimeout()
|
|
PrintWriter |
getLogWriter()
|
|
Logger |
getParentLogger()
|
|
String |
getPassword()
データベースの接続パスワードを返します。 |
|
String |
getUrl()
データベースへの接続URLを返します。 |
|
String |
getUser()
データベースの接続ユーザーを返します。 |
|
boolean |
isWrapperFor(Class<?> iface)
|
|
void |
setLoginTimeout(int seconds)
|
|
void |
setLogWriter(PrintWriter out)
|
|
void |
setPassword(String password)
データベースの接続パスワードを設定します。 |
|
void |
setUrl(String url)
データベースの接続URLを設定します。 |
|
void |
setUser(String user)
データベースの接続ユーザーを設定します。 |
|
|
unwrap(Class<T> iface)
|
|
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected static final String UNABLE_TO_ESTABLISH_CONNECTION
SQLState コードです。
protected String url
jdbc:subprotocol:subnameという形式のデータベースへの接続URLです。
protected String user
protected String password
protected final Properties properties
| コンストラクタの詳細 |
|---|
public SimpleDataSource()
| メソッドの詳細 |
|---|
public String getUrl()
public void setUrl(String url)
url - jdbc:subprotocol:subnameという形式のデータベースへの接続URLpublic String getUser()
public void setUser(String user)
user - データベースの接続ユーザーpublic String getPassword()
public void setPassword(String password)
password - データベースの接続パスワード
public void addProperty(String key,
String value)
key - プロパティのキーvalue - プロパティの値public int getLoginTimeout()
CommonDataSource 内の getLoginTimeoutpublic void setLoginTimeout(int seconds)
CommonDataSource 内の setLoginTimeout
public Connection getConnection()
throws SQLException
DataSource 内の getConnectionSQLException
public Connection getConnection(String user,
String password)
throws SQLException
DataSource 内の getConnectionSQLException
protected Connection getConnectionInternal(Properties info)
throws SQLException
info - JDBCドライバへのプロパティ
SQLException - SQLに関する例外が発生した場合
public PrintWriter getLogWriter()
throws SQLException
CommonDataSource 内の getLogWriterSQLException
public void setLogWriter(PrintWriter out)
throws SQLException
CommonDataSource 内の setLogWriterSQLException
public boolean isWrapperFor(Class<?> iface)
throws SQLException
Wrapper 内の isWrapperForSQLException
public <T> T unwrap(Class<T> iface)
throws SQLException
Wrapper 内の unwrapSQLException
public Logger getParentLogger()
throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||