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 classes12.zip 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
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.
Refer the following document which describes "Use SAP J2EE Database Pooling Service"
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/stu/use sap j2ee database pooling service
This will help you in adding a new driver, creating a new datasource and accessing the same.
Hope this is helpful to you.