Workshop allows you to connect to any database and analyze database
schemas, tables and columns. The
DbXplorer view provides an intuitive interface for database access. You can set up the database connection, drill down into database artifacts,
query the data in an existing table or column, and generate EJB3 persistence or Hibernate mappings.
Establishing the database connection
In order to take advantage of Workshop's database capabilities, you must first establish the connection to the database. This is done through the DbXplorer view. During the connection setup the database driver, connection URL, and login information are required.
Note: If the DbXplorer is not currently open, go to the Window menu
and select Show View > DbXplorer.
From the DbXplorer view, right click and select New Connection.
Assign a name to the Connection Name field and then click Next. The name can be arbitrary and does not have to match the actual name of the database server.
Add the database driver to the Driver Classpath by clicking
the Add button and browsing to the location of the JAR or
ZIP file(s) containing the driver. After adding the driver, click Next.
Note that database drivers are recorded as absolute paths. For this reason,
relocating the application code can break the database connection.
Add the fully qualified name of the JDBC Driver Class or
Browse to the appropriate driver. Workshop provides sample
Database URL's for some of the common databases which can be accessed from
the Populate from database defaults pull down menu. If the
database requires login information, it can be added to the User
and Password fields.
Finally, click the Test Connection button to verify that the connection information is correct and click Finish. The new database connection should now appear in the DbXplorer.
Congratulations! The new database connection has been configured and should now appear in the DbXplorer. If at anytime, the connection properties need to be updated, right click the connection and select Edit Connection.
Navigating the database with DbXplorer
Once the connection has been established, use DbXplorer to browse database contents.
By expanding the branches for the connection, you can display the database, schemas, tables, and columns. Notice that DbXplorer denotes which columns have been designated as primary keys.
While browsing database artifacts, the Properties view displays the relevant properties of the component. In the below example, the properties of the address column are displayed.
For large databases with many schemas, it might be necessary to hide the
schemas not in use. Right-click a schema and select Hide Selected
Schemas to remove it from the DbXplorer (this step does not modify
the database or the schemas). To display all of the schemas again, right click
the database and select Show Hidden Schemas.