[H2] open-source, in-memory Java database-H2 database Introduction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.