Skip to Content
Former Member
Jul 20, 2005 at 03:31 PM

Creating Oracle DataSource


I have been trying to access an internal Oracle database from within a servlet in a Web Module Project created with NetWeaver Developer Studio. I have used the Visual Administrator to set up my Oracle JDBC driver and data source.

I believe that there is a problem with my datasource itself or the driver that I'm using. I am not getting any specific error in the servlet, but none of the statements after the ds.getConnection(); statement get executed when I'm pointing to the OracleDB alias:

InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/OracleDB");

Connection con = ds.getConnection();

If I point the datasource to a SQL Server alias (SQLServerDB) that I've tested to be working, then the statements following the ds.getConnection(); statement get executed. This leads me to believe that it is definitely a problem with the datasource.

For the driver, I created two separate drivers, one with the file, the other with the ojdbc14.jar file from Oracle. I have switched between the two drivers, but neither produce any results.

For the database, I have set the following:

JDBC Version: 2.0 (with XA support)

Object Factory: oracle.jdbc.pool.OracleDataSourceFactory

DataSource Type: XADataSource

XADS Classname: oracle.jdbc.xa.client.OracleXADataSource

...and also tried...

DataSource Type: ConnectionPoolDataSource

CPDS Classname: oracle.jdbc.pool.OracleConnectionPoolDataSource

Additional Properties

User: username

Password: password

URL: jdbc:oracle:thin@IPAddress:Port:OracleSID

SQL Engine: Vendor SQL

Not sure if I have the correct connection parameters or if I'm using the correct drivers. Any help would be great.