Configuring a DataSource in Eclipse

Terms DataSource and Database Connection Profile are interchangeably used by Eclipse. General guidelines for this procedure are available at Eclipse guidelines for creating a new database connection profile. The following section illustrates building of the MySQL Community Server DataSource backed by the sample database cleardb.

Creating MySQL DataSource for cleardb Database

Navigate to Eclipse DataSource Explorer View of Eclipse JEE perspective. If you don’t see it, go to the menu Window | Show View | Data Management and select Data Source Explorer. Right-mouse click DataBase Connections and select New:

Create the New DataSource

Select the profile type MySQL, enter cleardb as the name of the datasource and click Next:

Create MySQL profile

Now select an existing DBMS Driver and provide Connection Details In the “New Connection Profile” dialog. If this is the first installation of MySQL Database Profile in your Eclipse workspace, you can NOT do that until you provide the location of the driver jar by clicking on the red-circled area next to the Driver combobox:

This will open the New Driver Definition dialog shown below:

Click on the Jar List and add the location on your disk of the mysql-connector-java-5.1.XX-bin.jar (see Sample Database - cleardb to obtain the download URL of the Jar):

Once the driver is defined, in the New Connection Profile dialog / “Specify a Driver and Connection Details” you should set the default values as shown below. However, you may need to provide your own password for MySQL root account. NOTE: By now your local MySQL server instance has to be up and running and contain cleardb schema (see Sample Database - cleardb for instructions on installing MySQL and configuring the cleardb)

Check your connection by clicking on TestConnection:

Expand the new DataSource profile - it should look like this:

clearwiki/20.cleardatabuilder/02.creating_cdb_project/02.building_workspace_datasource.txt · Last modified: 2011/07/13 12:29 (external edit)
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0