クラス org.objectweb.cjdbc.driver.DataSource

org.objectweb.cjdbc.driver.DataSourceのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

説明

An implementation of the JDBC 2.0 optional package DataSource interface. It allows to set the URL, user name, and password to its properties. It can be bound via JNDI so that the properties can be set by an "application server" and a "ready-to-use" reference to DataSource can be retrieved via JNDI.

作者:
Marek Prochazka
バージョン:
1.0

DataSource.java47 行で定義されています。

Public メソッド

 DataSource ()
java.sql.Connection getConnection () throws SQLException
java.sql.Connection getConnection (String user, String password) throws SQLException
void setLogWriter (PrintWriter output) throws SQLException
java.io.PrintWriter getLogWriter ()
void setLoginTimeout (int seconds) throws SQLException
int getLoginTimeout () throws SQLException
Reference getReference () throws NamingException
String getDescription ()
void setUrl (String url)
void setURL (String url)
String getUrl ()
String getURL ()
void setUser (String userName)
String getUser ()
void setPassword (String pwd)

Protected メソッド

java.sql.Connection getConnection (Properties props) throws SQLException

Protected 変数

String url = null
String user = null
String password = null
PrintWriter logWriter = null

Static Protected 変数

final String URL_PROPERTY = "url"
final String USER_PROPERTY = Driver.USER_PROPERTY
final String PASSWORD_PROPERTY = Driver.PASSWORD_PROPERTY
final String DRIVER_CLASSNAME = "org.objectweb.cjdbc.driver.Driver"
final String FACTORY_CLASSNAME = "org.objectweb.cjdbc.driver.DataSourceFactory"
final String DESCRIPTION_PROPERTY = "description"
Driver driver = null

スタティック関数

 [static initializer]


コンストラクタとデストラクタ

org.objectweb.cjdbc.driver.DataSource.DataSource  ) 
 

Default constructor. DataSource.java85 行で定義されています。

00086 { 00087 }


メソッド

org.objectweb.cjdbc.driver.DataSource.[static initializer]  )  [static, package]
 

java.sql.Connection org.objectweb.cjdbc.driver.DataSource.getConnection Properties  props  )  throws SQLException [protected]
 

Creates a connection using the specified properties.

引数:
props connection properties.
例外:
SQLException if an error occurs.
戻り値:
a new connection.
DataSource.java302 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Driver.connect(), org.objectweb.cjdbc.driver.DataSource.driver, と org.objectweb.cjdbc.driver.DataSource.url.

00304 { 00305 return driver.connect(url, props); 00306 }

java.sql.Connection org.objectweb.cjdbc.driver.DataSource.getConnection String  user,
String  password
throws SQLException
 

Gets connection. Retrieves a new connection using the user name and password specified.

引数:
user user name.
password password.
戻り値:
a new connection.
例外:
SQLException if an error occurs.
DataSource.java113 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.getConnection(), org.objectweb.cjdbc.driver.DataSource.password, org.objectweb.cjdbc.driver.DataSource.PASSWORD_PROPERTY, org.objectweb.cjdbc.driver.DataSource.user, と org.objectweb.cjdbc.driver.DataSource.USER_PROPERTY.

00115 { 00116 if (user == null) 00117 { 00118 user = ""; 00119 } 00120 if (password == null) 00121 { 00122 password = ""; 00123 } 00124 Properties props = new Properties(); 00125 props.put(USER_PROPERTY, user); 00126 props.put(PASSWORD_PROPERTY, password); 00127 00128 return getConnection(props); 00129 }

java.sql.Connection org.objectweb.cjdbc.driver.DataSource.getConnection  )  throws SQLException
 

Gets connection. Retrieves a new connection using the user name and password that have been already set.

例外:
SQLException if an error occurs.
戻り値:
a new connection.
DataSource.java99 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.password, と org.objectweb.cjdbc.driver.DataSource.user.

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection().

00100 { 00101 return getConnection(user, password); 00102 }

String org.objectweb.cjdbc.driver.DataSource.getDescription  ) 
 

Return the description of this Datasource with the Driver version number.

戻り値:
Datasource description
DataSource.java202 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.driver, org.objectweb.cjdbc.driver.Driver.getMajorVersion(), と org.objectweb.cjdbc.driver.Driver.getMinorVersion().

参照元 org.objectweb.cjdbc.driver.DataSource.getReference().

00203 { 00204 return "C-JDBC " + driver.getMajorVersion() + "." 00205 + driver.getMinorVersion() + " Datasource"; 00206 }

int org.objectweb.cjdbc.driver.DataSource.getLoginTimeout  )  throws SQLException
 

Gets the login timeout.

戻り値:
login timeout
例外:
SQLException in case of an error occurs.
DataSource.java168 行で定義されています。
00169 { 00170 return 0; 00171 }

java.io.PrintWriter org.objectweb.cjdbc.driver.DataSource.getLogWriter  ) 
 

Gets the log writer.

戻り値:
log writer.
DataSource.java147 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.logWriter.

00148 { 00149 return logWriter; 00150 }

Reference org.objectweb.cjdbc.driver.DataSource.getReference  )  throws NamingException
 

Gets a reference to this. The factory used for this class is the DataSourceFactoryclass.

戻り値:
a reference to this.
例外:
NamingException if DataSourceFactory not found.
DataSource.java183 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.DESCRIPTION_PROPERTY, org.objectweb.cjdbc.driver.DataSource.FACTORY_CLASSNAME, org.objectweb.cjdbc.driver.DataSource.getDescription(), org.objectweb.cjdbc.driver.DataSource.getUrl(), org.objectweb.cjdbc.driver.DataSource.getUser(), org.objectweb.cjdbc.driver.DataSource.password, org.objectweb.cjdbc.driver.DataSource.PASSWORD_PROPERTY, org.objectweb.cjdbc.driver.DataSource.URL_PROPERTY, と org.objectweb.cjdbc.driver.DataSource.USER_PROPERTY.

00184 { 00185 Reference ref = new Reference(getClass().getName(), FACTORY_CLASSNAME, null); 00186 ref.add(new StringRefAddr(DESCRIPTION_PROPERTY, getDescription())); 00187 ref.add(new StringRefAddr(USER_PROPERTY, getUser())); 00188 ref.add(new StringRefAddr(PASSWORD_PROPERTY, password)); 00189 ref.add(new StringRefAddr(URL_PROPERTY, getUrl())); 00190 return ref; 00191 }

String org.objectweb.cjdbc.driver.DataSource.getURL  ) 
 

Gets URL of the C-JDBC controller(s) to connect. The URL is stored in the URL_PROPERTYproperty.

戻り値:
URL to be used to connect C-JDBC controller(s).
DataSource.java249 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.getUrl().

00250 { 00251 return getUrl(); 00252 }

String org.objectweb.cjdbc.driver.DataSource.getUrl  ) 
 

Gets url of the C-JDBC controller(s) to connect. The URL is stored in the URL_PROPERTYproperty.

戻り値:
URL to be used to connect C-JDBC controller(s).
DataSource.java238 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.url.

参照元 org.objectweb.cjdbc.driver.DataSource.getReference(), と org.objectweb.cjdbc.driver.DataSource.getURL().

00239 { 00240 return url; 00241 }

String org.objectweb.cjdbc.driver.DataSource.getUser  ) 
 

Gets user name to be used to connect the C-JDBC controller(s). The user name is stored in the USER_PROPERTYproperty.

戻り値:
user name to be used to connect C-JDBC controller(s).
DataSource.java273 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.user.

参照元 org.objectweb.cjdbc.driver.DataSource.getReference().

00274 { 00275 return user; 00276 }

void org.objectweb.cjdbc.driver.DataSource.setLoginTimeout int  seconds  )  throws SQLException
 

Sets the timeout. Actually does nothing.

引数:
seconds timeout in seconds.
例外:
SQLException in case of an error occurs.
DataSource.java158 行で定義されています。
00159 { 00160 }

void org.objectweb.cjdbc.driver.DataSource.setLogWriter PrintWriter  output  )  throws SQLException
 

Sets the log writer for this data source.

引数:
output print writer.
例外:
SQLException in case of an error occurs.
DataSource.java137 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.logWriter.

00138 { 00139 logWriter = output; 00140 }

void org.objectweb.cjdbc.driver.DataSource.setPassword String  pwd  ) 
 

Sets password to be used to connect the C-JDBC controller(s). The method can be used by the "application server" to set the password (potentially according a deployment descriptor). The password is stored in the PASSWORD_PROPERTYproperty. Note that there is not a getPassword method.

引数:
pwd password to be used to connect C-JDBC controller(s).
DataSource.java287 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.password.

参照元 org.objectweb.cjdbc.driver.DataSourceFactory.getObjectInstance().

00288 { 00289 password = pwd; 00290 }

void org.objectweb.cjdbc.driver.DataSource.setURL String  url  ) 
 

Sets URL of the C-JDBC controller(s) to connect. The method is used by the "application server" to set the URL (potentially according a deployment descriptor). The URL is stored in the "url" property.

引数:
url URL to be used to connect C-JDBC controller(s).
DataSource.java227 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.setUrl().

00228 { 00229 setUrl(url); 00230 }

void org.objectweb.cjdbc.driver.DataSource.setUrl String  url  ) 
 

Sets url of the C-JDBC controller(s) to connect. The method is used by the "application server" to set the URL (potentially according a deployment descriptor). The url is stored in the URL_PROPERTYproperty.

引数:
url URL to be used to connect C-JDBC controller(s)
DataSource.java215 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSourceFactory.getObjectInstance(), と org.objectweb.cjdbc.driver.DataSource.setURL().

00216 { 00217 this.url = url; 00218 }

void org.objectweb.cjdbc.driver.DataSource.setUser String  userName  ) 
 

Sets user name to be used to connect the C-JDBC controller(s). The method can be used by the "application server" to set the user name (potentially according a deployment descriptor). The user name is stored in the USER_PROPERTYproperty.

引数:
userName user name to be used to connect C-JDBC controller(s).
DataSource.java262 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSource.user.

参照元 org.objectweb.cjdbc.driver.DataSourceFactory.getObjectInstance().

00263 { 00264 user = userName; 00265 }


変数

final String org.objectweb.cjdbc.driver.DataSource.DESCRIPTION_PROPERTY = "description" [static, protected]
 

DataSource.java60 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getReference().

Driver org.objectweb.cjdbc.driver.DataSource.driver = null [static, protected]
 

Wrapped driver for to get connections. DataSource.java63 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), と org.objectweb.cjdbc.driver.DataSource.getDescription().

final String org.objectweb.cjdbc.driver.DataSource.DRIVER_CLASSNAME = "org.objectweb.cjdbc.driver.Driver" [static, protected]
 

DataSource.java58 行で定義されています。

final String org.objectweb.cjdbc.driver.DataSource.FACTORY_CLASSNAME = "org.objectweb.cjdbc.driver.DataSourceFactory" [static, protected]
 

DataSource.java59 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getReference().

PrintWriter org.objectweb.cjdbc.driver.DataSource.logWriter = null [protected]
 

DataSource.java80 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getLogWriter(), と org.objectweb.cjdbc.driver.DataSource.setLogWriter().

String org.objectweb.cjdbc.driver.DataSource.password = null [protected]
 

DataSource.java79 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), org.objectweb.cjdbc.driver.DataSource.getReference(), と org.objectweb.cjdbc.driver.DataSource.setPassword().

final String org.objectweb.cjdbc.driver.DataSource.PASSWORD_PROPERTY = Driver.PASSWORD_PROPERTY [static, protected]
 

DataSource.java57 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), と org.objectweb.cjdbc.driver.DataSource.getReference().

String org.objectweb.cjdbc.driver.DataSource.url = null [protected]
 

DataSource properties DataSource.java77 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), と org.objectweb.cjdbc.driver.DataSource.getUrl().

final String org.objectweb.cjdbc.driver.DataSource.URL_PROPERTY = "url" [static, protected]
 

DataSource properties DataSource.java55 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getReference().

String org.objectweb.cjdbc.driver.DataSource.user = null [protected]
 

DataSource.java78 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), org.objectweb.cjdbc.driver.DataSource.getUser(), と org.objectweb.cjdbc.driver.DataSource.setUser().

final String org.objectweb.cjdbc.driver.DataSource.USER_PROPERTY = Driver.USER_PROPERTY [static, protected]
 

DataSource.java56 行で定義されています。

参照元 org.objectweb.cjdbc.driver.DataSource.getConnection(), と org.objectweb.cjdbc.driver.DataSource.getReference().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.1に対してWed Aug 18 09:20:32 2004に生成されました。 doxygen 1.3.8