Monday, February 11, 2013

How to create H2 database from H2 DB engine UI

Using following simple steps you can create your own H2 database with in few minutes.

1. Download H2 database engine UI from here.

2. Extract downloaded pack and go to the bin directory.
   ex : "/h2/bin"

3. Start DB console.
    if you are in Linux : sh
    if you are in windows : h2.bat

4. Once you start it, you will see H2 database console you browser.


5. if your console doesn't have H2 configuration go to the "" file locates in your home directory (Linux). if you are using windows this will be at user/documents and settings.

6. Open it and add below entry in file.
 "2=Generic H2 (Embedded)|org.h2.Driver|jdbc\:h2\:LOCATION-OF-DATABASE-WANT-TO-CRATE"

7. Now restart and now you will see H2 configuration.

8. Enter database name what you add in properties file and enter new user name and password to that database.

9. Click connect button and now it creates new database and login to the database.