• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which jar file in WAS v5 contains DataSourceFactory

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic