Several things to point out here.
Firstly, the recommended way to connect to a database in an application server is via a DataSource. You register the DataSource in the Server Configuration, and it gets bound JNDI. In your code you get the DataSource from JNDI then ask it for a Connection. This is preferred since it allows the application server to manage Connections in all applications running in the application server. This means hungry applications won't choke other apps or the database by opening too many Connections, and the Application serever can provide the Connections via a Connection Pool to greatly improve performance. There is a bit of a trick to authenticating DataSources in WSAD5/WAS5, but I'll find a
thread for that in a minute.
Looking at your sample code, this is not the recommended way to directly access a DRiver either. if you call Class.forName( drive name ), the Driver registers itself with the Driver manager when it is loaded. You don't have to
and should not register it manually, since it registers the Driver twice and can cause errors.
The third point is that application servers ignore the system classpath. This allows them to provide a custom classpath for each application running inside it. You need to add the driver jar to the application classpath in the app serever settings, but setting it up as a DataSource will take care of this for you.
Now I'll go look for the 'DataSource in WSAD 5' thread...
Dave