H2

Anonymous
2011-02-13
2013-04-29

  • Anonymous
    2011-02-13

    hello,

    is it possible to connect to a portable H2 db?

    thanks
    z

     
  • Heiko Hilbert
    Heiko Hilbert
    2011-03-03

    Yes. You cann connect any DB providing a JDBC-Driver.
    Here's the way to go.

    Add a new driver configuration for H2 database:
    - GoTo: Settings / SQL Explorer / JDBC Drivers
    - click Add to open New Driver Dialog
    -Choose a name for the Driver (H2), Set Example Url (jdbc:h2:~/test), Select 'Extra Class Path' Tab, click Add JARs and select your H2-jar (h2-1.3.152.jar), then click List Drivers. In the Driver Class Name boy should be selected org.h2.Driver. Click Ok
    - You should have a new Driver in the list marked with a green check mark

    Create a Connection Profile
    - GoTo: SQL Explorer Perspective
    - In the Connection View click on Create new Connection Profile
    - Choose a name (h2), select your newly defined driver, URL should be jdbc:h2:~/test, as User set 'sa', check AutoCommit, click ok

    Now you are ready to open your connection. :-)

    Don't forget to start your H2 database before trying to connect.