How to create a H2 connection profile in Eclipse

On September 6, 2011, in Eclipse, H2, by lucasterdev

(from http://www.manning-sandbox.com/message.jspa?messageID=85357)

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
Optionally, on the “Properties” tab you can set the following defaults:
Connection URL: jdbc:h2:mem
Database Name: PUBLIC
Driver Class: org.h2.Driver
User ID: sa
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.

 

Leave a Reply