Content:
1. Main Features of H2 Database Engine
2. Comparison with other SQL features
3. Use
4. Connect to the H2 database using JDBC in the Java EE program
1. Main Features of H2 Database Engine
- Very fast, open-source, JDBC API
- Embedded and server mode, Memory Database
- Browser-based control program
- Small Size: the size of the JAR file is about 1 MB.
2. Comparison with other SQL features
3. Use
3.1 download the program
Download the app on H2's official website (http://www.h2database.com) And I chose "all platforms" (no installation required)
3.2 use
Decompress the ZIP file to a directory (such as D: \ H2), enter the Directory D: \ H2 \ bin, run the h2.bar program, and a console appears, A few seconds later, enter the browser control mode:
Click "Connect" to go to the following page:
My H2 experience is: extremely fast and suitable for software development.
4. Connect to the H2 database using JDBC in the Java EE program
The Directory D: \ H2 \ bin mentioned in 3.2 contains a jar file, which is copied to the corresponding directory of the Java EE Project. In my program, the Hibernate open-source framework is used. cfg. the xml configuration is as follows:
<property name="connection.driver_class">org.h2.Driver</property><property name="connection.url">jdbc:h2:~/test</property><property name="connection.username">sa</property><property name="connection.password"></property><!-- SQL dialect --><property name="dialect">org.hibernate.dialect.H2Dialect</property>
References:
[1] H2 Official Website: http://www.h2database.com
Note:
System: Windows XP Professional
Green software: mycatchscreen.exe
Image editing software: mspaint
Eclipse: myeclipse 6.5