How to get Oracle JDeveloper working with a MySQL database?
First you need Oracle JDeveloper version 10.1.3.3 or up (because previous versions contain some bugs and therefor it will not work). You can download the latest version from the oracle website. Next thing you need is the MySQL jdbc driver: mysql-connector-java-5.1.5.tar.gz. This driver can be downloaded from the MySQL developer website.
Start JDeveloper and create a new asynchronous BPEL process.
Assume you have a MySQL database running with the following table:
Our goal is to get a name on basis of an ID number. The id number is the input (buy side) for our webservice and the name is the output (sell side). In JDeveloper we start the new database connection wizard. Set the connection type to Third Party JDBC Driver. At step 3, we click New... at the Driver Class. We browse for a library. We click on New... in the Select Library window. We click on Add Entry in the Create Library window, and select our MySQL JDBC Driver. Click on ok in the Create Library window, click again ok in the select library window. Now we are again in the Register JDBC Driver window. for Driver Class you fill in:
The class path is filled in automatically. Click Ok. At the URL entry we fill in:
We then click next and test the connection. The connection is successful and we Finish the wizard. We now start the SQL Worksheet (Tools > SQL Worksheet) and test our connection. We run the query:
and we get the desired result
We now add a Database Adapter to our BPEL project. We fill in the service name get_name. For the connection we select the just set up MySQL connection. For the operation type we select Perform an Operation on a Table and we only select Select. We then import the tables we want to do this operation on. In this case this is just the members table. We add one input Parameter inputID and we fill in the query
We then add an invoke operation to invoke the get\_name database adapter. We add two assigns. We assign the inputvariable to the inputvariable for the invoke. And we assign the output variable of the invoke to the outputvariable. We now have created a BPEL process which uses a MySQL Database. Your final BPEL process should look something like the one below (names can differ).