Setting up Database Connections

 Select the Connection Navigator panel from the tool palette on the left side of the IDE.  If you don't see it, you can activate it by selecting Connection Navigator from the View menu.  It should look like this:

 


 

 Right click on the Database folder and select New Database Connection.  The Database Connection Wizard dialog will appear:

 

 

 

 Click Next and the following dialog will appear:

 


 

Give your new connection an appropriate name and select the Connection Type:  Oracle or Third Party JDBC Driver (for MySQL, etc.).  Click Next and the user authentication dialog will appear:

 

 

Enter a user name and password and select Deploy Password so you don't have to enter the password every time you connect.  Click Next to proceed to the connection details
dialog:

 


 
 

Fill in the fields with the info pointing to your Oracle database.  If you want to connect to a non-Oracle database, follow the instructions in the MySQL example walkthrough, below:

 

Non-Oracle Specific Setup

(You selected Oracle or Third Party JDBC Driver in step 1 of the wizard) and you now see this dialog:

 

 
 

 

First we need to register an ODBC driver class for the new database connection to use.  You'll need to download the MySQL JDBC-thin driver.  Download MySQL Connector/J 3.1 (or compatible version) from http://dev.mysql.com/downloads/.  Decompress the archive to some location (remember it!) on your local disk.

Now return to the setup wizard and click the New... button to open the Registration dialog:

 


 

We have to find the library, so click the Browse... button and bring up the Library explorer:

 

  
 
 

Click the New... button.  The following dialog will appear:

 
 

 
Click the Add Entry... button to bring up a file selection dialog.  Navigate to the jar file in the archive you recently expanded (you have to use the '+' symbols at directory nodes to navigate in the file selection dialog, double clicking a directory icon will select it, erroneously.):

 

 

Select the .jar file and click OK to return to the library selector:

 
 

Make sure you've selected the new driver class and click OK to return to the library navigator:

 
 

 Select the new Library and click OK to return to the driver registration dialog:

 
 
You'll have to enter the Driver Class name manually -- for MySQL it is 'com.mysql.jdbc.Driver'.  Click OK.

You'll now return to the connection details dialog where you can select the newly registered driver and enter other connection-specific parameters.  The rest of the setup is the same as for Oracle.  Click OK and continue with the instructions below.

 
Click Next and you'll be able to test your new connection:

 
 

You can now click Next or Finish to return to the IDE.

 If you've done everything correctly, you'll see your new database connection appear in the Connection Navigator.  You can browse your database as below:

 

  • No labels