Home > Database, SOA Suite > Using SQL Server from ESB or BPEL in OC4J

Using SQL Server from ESB or BPEL in OC4J

Download Microsoft SQL Server JDBC Driver 2.0. When prompted pick the Unix version, which is an archive. Extract the files and locate sqljdbc.jar.

There are several ways to make the classes in the driver available to the platform, for example a shared library can be created. However, the easiest approach is to simply copy sqljdbc.jar to $ORACLE_HOME/applib. Restart the server.

Open Enterprise Manager and select Administration for the oc4j container where the driver is needed. Select JDBC Resources and create a new Connection Pool. Fill in Name, Connection Factory Class, JDBC URL, Username and Password. The correct connection factory class is com.microsoft.sqlserver.jdbc.SQLServerDataSource and the URL should be jdbc:sqlserver://host:1433;databaseName=somedb where host and somedb are the names of the database host and the database itself. The port (1433) may need to be changed as well. Test the connection with:


To use the connection factory with a database adapter, create two data sources as managed data sources using the connection pool, for example MSSQLDataSource and MSSQLDataSource-XA with JNDI locations jdbc/MSSQLDataSource and jdbc/MSSQLDataSource-XA (the names are arbitrary). Navigate to applications and click on default. In the Modules list, click on DbAdapter and select Connection Factories. Create a new one with dataSourceName=jdbc/MSSQLDataSource and xADataSourceName=jdbc/MSSQLDataSource-XA.

In jDeveloper, copy the jar file to j2ee\home\applib or create a shared library. Create a new connection. The driver class should be com.microsoft.sqlserver.jdbc.SQLServerDriver. Test the connection. It should now be possible to use the normal adapter wizards with SQL Server and to deploy and run the finished code.

Categories: Database, SOA Suite
  1. OC4J
    2017-12-19 at 12:27

    I was trying to create a connection pool through OC4J, but connection is failing as driver not existing. I copied sqljdbc.jar in home\applib and restarted the server. It worked to create database connection from jdev 10g but failing to create jndi through OC4J. Can you please help me on this.

  2. 2017-12-19 at 18:37

    I haven’t touched oc4j in ages, so I really don’t know. However, perhaps home\applib is the wrong place? If I remember correctly it was best practice to use home only for administration and another server for applications? Often it was called oc4jsoa or something. See if you can find a directory next to home and copy the driver to that folder’s applib as well.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: