Previous Next vertical dots separating previous/next from contents/index/pdf

Step 4. Connect and Analyze Database Schema Using DbXplorer

Workshop allows you to connect to any database, create and analyze database schemas, tables, columns, and even populate the database with sample data. In this step, we will learn how to create a database and explore it using DbXplorer.

DbXplorer provides an intuitive interface for database access through Workshop. It allows you to set up the database connection, review the database artifacts, query existing data, and generate Hibernate mappings.

The tasks in this step are:

To Create a New Database Connection

To Browse the Database Artifacts using DBXplorer

To Create a New Database Connection

  1. Open the DbXplorer view, if it is not visible. To open DbXplorer view, go to the Window menu and select Show View > DbXplorer .
  2. From within the DbXplorer view, right-click and select New Connection. (Alternatively, you can click the second icon 2nd on the menu bar of the DbXplorer view.)
  3. In the Add Database Connection Wizard, enter the database connection name. The database connection name can be arbitrary and does not have to match the actual name of the database server. For this tutorial, use the name SalesDBConnection. Click Next.

  4. In Add Database Connection dialog, click Add and select the Hypersonic JDBC driver file. For example, if your workspace folder is C:\MyData\workspace then the path would be C:\MyData\workspace\workshop-hibernate-tutorial\web\WEB-INF\lib\hsqldb.jar.

  5. Click Next.
  6. Click Browse and select org.hsqldb.jdbcDriver as the Hypersonic JDBC Driver class.
  7. Workshop provides sample Database URL's for some standard databases, which can be accessed from the Populate from database defaults pull down menu. Select HypersonicSQL In-Memory.

  8. For the database URL jdbc:hsqldb:{db filename}, specify the Hypersonic database script file location for {db filename}. For example, if your workspace folder is C:\MyData\workspace then the path would be C:\MyData\workspace\workspace\workshop-hibernate-tutorial\web\hsqlDB\salesDB.
  9. For User name, enter sa.

  10. Click the Test Connection button to verify the connection information.

  11. Click Finish.
  12. Workshop configures the new database connection and displays it in DbXplorer.

To Browse the Database Artifacts Using DBXplorer

DbXplorer allows you to browse the database components.

  1. In DbXplorer, expand the nodes inside the SalesDBConnection node. You can view the individual tables and columns. Observe that DbXplorer shows which columns have been designated as primary keys.

  2. While browsing database artifacts, the Properties view displays the relevant properties of the component.

Click one of the following arrows to navigate through the tutorial:


Still need help? Post a question on the Workshop newsgroup.

 

Skip navigation bar   Back to Top