In the above code, once I execute it I get this error: Exception Class = java.lang.reflect.InvocationTargetException Exception Stack = java.lang.reflect.InvocationTargetException: javax.naming.NoInitialContextException: Cannot instantiate class: com.microsoft.jdbc.sqlserver.SQLServerDataSource. Root exception is java.lang.ClassNotFoundException: com.microsoft.jdbcx.sqlserver.SQLServerDataSource I am trying to use Websphere 4.0 connection pooling feature using Microsoft SQL Server drivers. I've created the jndi/datasource and set the classpath using Websphere's interface; used Websphere's "Test Connection" feature and it has passed. I've checked that the datasource file that the error is indicating is in the *.jar. I've also tried another test by adding the system environment variable to point to the *jars, but still getting the same error. Any help would be appreciated.
(Code tags added by Michael Morris) [ April 23, 2004: Message edited by: Michael Morris ]
Amarakunthy, Where is this client getting called from? If it is a client outside of the container, you will still need to make sure that the DataSource class is part of the classpath. Other than that, I haven't a clue.
Nathaniel, All the driver's *.jar files are set on the system environment variable. I have sat down and tried every place possible that I can think of and still the same problem. Thanks for the suggestion though. Still hammering away .... Amarakunthy
The problem lies in your code. You don't specify the Datasource class as the InitialContext factory, you specify the InitialContext factory class instead! The datasource class is specified when you set up the datasource in the admin screen. I STRONGLY suggest you take a look at the Infocenter documentation on setting up datasources. Also take a look at the WebSphere 4.0 programming handbook redbook for information on what class to use when calling an InitialContext. Kyle