my dog learned polymorphism*
The moose likes Websphere and the fly likes Which jar file in WAS v5 contains DataSourceFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Which jar file in WAS v5 contains DataSourceFactory" Watch "Which jar file in WAS v5 contains DataSourceFactory" New topic
Author

Which jar file in WAS v5 contains DataSourceFactory

Rama Kalicut
Greenhorn

Joined: Sep 12, 2003
Posts: 4
Hi,
I'm trying to create a datsource from a class file. With WAS v4, I know that DataSourceFacotry is in ujc.jar. But, I need it for WAS v5.
My java code:::::::::::::
// Create a properties file for the DataSource
java.util.Properties prop = new java.util.Properties();
prop.put(DataSourceFactory.NAME, "SampleDB");
prop.put(DataSourceFactory.DATASOURCE_CLASS_NAME,
"COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource");
prop.put(DataSourceFactory.DESCRIPTION, "My sample datasource");
prop.put("databaseName", "sample");

// Obtain a DataSource from the factory
DataSource ds = DataSourceFactory.getDataSource(prop);

// Bind the DataSource into JNDI
DataSourceFactory.bindDataSource(ds);
Thanks
kalicut
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
Doing a search of the v5 infocenter (http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp) for DataSourceFactory comes up with exactly zero results.
Searching the jars in the lib folder for it comes up with exactly zero results.
Hence, I suspect this capability no longer exists in WAS 5. However, a JMX extension is provided.
So I think maybe a better question is whether your app really needs to dynamically create data sources. Can you simply configure them initially and connect to them...?


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which jar file in WAS v5 contains DataSourceFactory
 
Similar Threads
failed using programmaticall created datasource
Websphere Connection Pooling
API's for creating data sources
CONNECTION POOL in WAS 3.5
Connect to websphere data source from external application