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

すべてのメンバ一覧

説明

DataSource factory for to implement Referenceable. The factory serves for the DataSource,PooledDataSource, and XADataSource classes.

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

DataSourceFactory.java41 行で定義されています。

Public メソッド

Object getObjectInstance (Object objRef, Name name, Context nameCtx, Hashtable env) throws Exception

Protected 変数

final String dataSourceClassName = "org.objectweb.cjdbc.driver.DataSource"
final String poolDataSourceName = "org.objectweb.cjdbc.driver.PoolDataSource"
final String xaDataSourceName = "org.objectweb.cjdbc.driver.XADataSource"


メソッド

Object org.objectweb.cjdbc.driver.DataSourceFactory.getObjectInstance Object  objRef,
Name  name,
Context  nameCtx,
Hashtable  env
throws Exception
 

Gets an instance of the requested DataSource object.

引数:
objRef object containing location or reference information that is used to create an object instance (could be null).
name name of this object relative to specified nameCtx (could be null).
nameCtx name context (could ne null if the default initial context is used).
env environment to use (could be null if default is used)
戻り値:
a newly created instance of C-JDBC DataSource, null if an error occurred.
例外:
Exception if an error occurs when creating the object instance.
DataSourceFactory.java62 行で定義されています。

参照先 org.objectweb.cjdbc.driver.DataSourceFactory.dataSourceClassName, org.objectweb.cjdbc.driver.DataSourceFactory.poolDataSourceName, org.objectweb.cjdbc.driver.DataSource.setPassword(), org.objectweb.cjdbc.driver.DataSource.setUrl(), org.objectweb.cjdbc.driver.DataSource.setUser(), と org.objectweb.cjdbc.driver.DataSourceFactory.xaDataSourceName.

00064 { 00065 // Check the requested object class 00066 Reference ref = (Reference) objRef; 00067 String className = ref.getClassName(); 00068 if ((className == null) 00069 || !(className.equals(dataSourceClassName) 00070 | className.equals(poolDataSourceName) | className 00071 .equals(xaDataSourceName))) 00072 { 00073 // Wrong class 00074 return null; 00075 } 00076 DataSource ds = null; 00077 try 00078 { 00079 ds = (DataSource) Class.forName(className).newInstance(); 00080 } 00081 catch (Exception e) 00082 { 00083 throw new RuntimeException("Error when creating C-JDBC" + className 00084 + " instance: " + e); 00085 } 00086 00087 ds.setUrl((String) ref.get(DataSource.URL_PROPERTY).getContent()); 00088 ds.setUser((String) ref.get(DataSource.USER_PROPERTY).getContent()); 00089 ds.setPassword((String) ref.get(DataSource.PASSWORD_PROPERTY).getContent()); 00090 return ds; 00091 }


変数

final String org.objectweb.cjdbc.driver.DataSourceFactory.dataSourceClassName = "org.objectweb.cjdbc.driver.DataSource" [protected]
 

DataSource classnames. DataSourceFactory.java44 行で定義されています。

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

final String org.objectweb.cjdbc.driver.DataSourceFactory.poolDataSourceName = "org.objectweb.cjdbc.driver.PoolDataSource" [protected]
 

DataSourceFactory.java45 行で定義されています。

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

final String org.objectweb.cjdbc.driver.DataSourceFactory.xaDataSourceName = "org.objectweb.cjdbc.driver.XADataSource" [protected]
 

DataSourceFactory.java46 行で定義されています。

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


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