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

4. Connect and analyze database schema using DbXplorer™

Workshop Studio allows you to connect to any database, analyze database schemas, tables, columns, and even populate the database with sample data. In this section of the tutorial, we will learn how to explore databases using DbXplorer.

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

4.1. 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..

  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. Click Next.

  4. In Add Database Connection dialog, click Add and select the Hypersonic JDBC driver file e.g., 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} e.g., 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 Studio configures the new database connection and displays it in DbXplorer.

  13. DbXplorer also allows you to edit or remove the connection configuration. If you right click on a database connection, you can change your connection settings.

4.2. Browse the database artifacts and review their properties

DbXplorer allows you to browse the database components.

  1. In DbXplorer, expand the branches for the SalesDBConnection. You can view the 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.

  3. For large databases with many schemas, it might be necessary to hide the schemas not in use. To hide a schema, right-click on the schema name and select Hide Selected Schemas to remove it from the DbXplorer view (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.

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

 

Skip navigation bar   Back to Top