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:


SELECT @@VERSION

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.

Advertisements
Categories: Database, SOA Suite
  1. No comments yet.
  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: