My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
AddH2ConnectionInJBossTools  
Explains how to register the H2 driver and add an H2 connection in JBoss Tools.
Updated Feb 4, 2010 by dan.j.allen

Introduction

The sample application for Seam in Action uses the H2 database. Unfortunately, H2 is not recognized out of the box by Eclipse/JBossTools. This page describes how to register the H2 driver and use it to create a connection.

Steps

When using the new Seam Web Project wizard in JBoss Tools, you will arrive at the screen that asks you to select the database and connection type. H2 is now supported as a database type, but not yet as a standard driver with Eclipse. Therefore, you need to click on the "New..." button next to the "Connection Profile..." label.

In the window that comes up, define new connection type named "H2" from "Generic JDBC"

On next screen, click the button to define a "New Driver Definition" On the screen that pops up, click on "Generic JDBC Driver" and rename to "H2"

Click on the "Jar List" tab and add the H2 JAR to the list

On the "Properties" tab you can set the following defaults, most importantly the driver class:

Click "OK"

Now you should be able to select H2 from the list of Drivers Enter the proper JDBC URL for H2 (somethink like jdbc:h2:file:///home/twoputt/databases/open18-db/h2) Click Test Connection

Remember, when using H2 in embedded mode, you can only have a single connection open. I encourage you to research how to use H2 in TCP mode (like a regular database) because it's hard to control when Eclipse opens/closes connections to the database.


Sign in to add a comment
Powered by Google Project Hosting