Eclipse 18 Jul 2006 07:42 am

“Database Explorer” versus “Data Source Explorer”

Seems like a simple question, and after a bit of digging, it does have a simple answer. The latest Eclipse 3.2 release, after upgrading with Callisto, contains two parallel database components. The first one was developed out of necessity for the Web Tools Platform (WTP), to enable a graphical interface for J2EE development. The second one is a more generic project, the Data Tools Platform (DTP), to create a broad interface for interacting with all sorts of data sources. The WTP component supports database-specific connections, while the DTP supports generic data source connections which happens to include databases.

The problem is that WTP needed to interact with databases before DTP was available, so its database interface mirrors the functionality in DTP. Although plans exist to merge the two, the timeline for that drags into next year, targeting the yet-to-be-started Eclipse 3.3.

So we’re stuck with both database interfaces, which don’t interact with each other, and don’t share JDBC connection setups. To summarize, DTP offers the more generic Data Source Explorer view. The BIRT reporting tool seems to be the main user of DTP. You can set up a database connection in Data Source Explorer, but it won’t be accessible to any J2EE development you’re doing with the WTP tools.

With WTP, which you need for JSP, JSF, and EJB development, you’ll need to use the Database Explorer view. For example, to set up a MySQL connection, you would open the Database Explorer view, right-click (or Ctrl-click on Mac) the Connections icon and choose New Connection; then select a MySQL database manager on the left. Since no MySQL presets exist yet, go with a JDBC Driver of “Other”. Fill in your MySQL database name, “com.mysql.jdbc.Driver” for the JDBC driver class, point Class location to your mysql-connector-java-3.1.x-bin.jar file, and set the Connection URL to something like “jdbc:mysql://localhost:3306/mydb”. With that, your database connection should be available to all your WTP tools, like JSF, Dali, and so on.

In a later post, I’ll dive into the Dali JPA plugin.

Comments are closed.