This is a slightly lengthy description, so please bear with me...
1. Go to the 'Server Perspective' in WSAD.
2. If you have a server set up already, u will need to click on the server to set up the configuration.
3. Go to the Datasource Tab
4. Under 'JDBC Provider List', select the Add button.
5. Select Oracle and the Oracle Thin Driver.
6. Set the implementation class name to oracle.jdbc.pool.OracleConnectionPoolDataSource and specify a name (oracleDS) for this datasource.
7. Under DataSource, set a name (ORADS) and JNDI name (jdbc/ORADS). leave everything else as is.
8. Under Resource properties (with your ORADS Datasource selected), Add name as 'URL' and value as 'jdbc

racle:thin:@serverName

ort

b'.
9. Save this and restart your server.
10. Use the following code to retrieve the datasource:
try
{
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
parms.put(Context.PROVIDER_URL, "iiop:///");
InitialContext ctx = new InitialContext(parms);
DataSource ds = (DataSource)ctx.lookup("jdbc/ORADS"); // if that is what you named it...
}
catch(NamingException e)
{
System.out.println(e);
}
11. To Use the datasource,
ds.getConnection(userId, password);
I hope this helps...
Thanks,
Maneesh
