Pageviews

Saturday, July 27, 2013

JDeveloper - MySQL DB connection setup


JDeveloper - MySQL DB connection setup


JDeveloper connection to MySQL database is not straight forward, and certainly does not work with out of the box drivers. Check out the below screen shot for details. You need to download and add, Connector/J driver to establish the connection. MySQL Connector/J is the official JDBC driver for MySQL.

Follow the below instructions to download and configure, Connector/J driver.

Here is my connection details,

Connection In: Application Resources (selected by default)
Connection Name: dbConn
Connection Type: MySQL
Username : root

Under MySQL Settings:

Host Name: <Enter your hostname, in my case it is, localhost>
Port: Enter the default MySQL DB port number, 3306
Driver Class: com.mysql.jdbc.Driver (Default)
Library: <Press Browse to select a library>




The problem here is, MySQL connection library is not available by default to establish the MySQL DB connection. 
To resolve this issue, follow the below steps..

Step 1: 

To get the driver, navigate to the following link and download the jar file.


The above link takes you to the main download Connector/J driver location. From here, you have a choice to download as a compressed tar archive file or a zip archive format.

The above link2 takes you directly to download the Connector/J driver directly in zip archive format.

Step 2: 


Place the downloaded jar file under  a domain lib folder location. In my case, I placed the jar file in

Macintosh HD/Users/RajVenugopal/Oracle/Middleware/user_projects/applications/DefaultDomain/lib/mysql-jdbc-5.1.25

Quick Note: I renamed mysql-connector-java-5.1.25,zip to mysql-jdbc-5.1.25.zip. Unzipping the folder gets you the needed driver jar file.



Step 3:


In 'Create Database Connection' wizard, click the library browse button to open up "Select Library" window. Select User selection under Libraries. Click the "New" button to open the 'Create Library' window. Then click 'Add Entry' button to add the downloaded jar file to the library. Check out the below screenshot for details.








Step 4: 

Add the download jar file to the user libraries, and then select 'Test Connection' to test the DB connection. You should get a successful db connection at this point.



Enjoy and have fun.

1 comment: