H2 (DBMS)
Encyclopedia
H2 is a relational database management system
written in Java
. It can be embedded in Java applications or run in the client-server mode. The disk footprint (size of the jar file
) is about 1 MB.
The software is available as open source
software under modified versions of the Mozilla Public License
or the original Eclipse Public License
. The modification of the MPL is a shorter file header and the license name.
(Structured Query Language) standard is supported. The main programming APIs are SQL
and JDBC, however the database also supports using the PostgreSQL
ODBC driver by acting like a PostgreSQL
server.
It is possible to create both in-memory tables, as well as disk-based tables. Tables can be persistent or temporary. Index types are hash table and tree for in-memory tables, and b-tree
for disk-based tables. All data manipulation operations are transactional
. Table level locking and multiversion concurrency control
are implemented. The 2-phase commit protocol is supported as well, but no standard API for distributed transactions is implemented. The security features of the database are: role based access rights, encryption of the password using SHA-256 and data using the AES
or the Tiny Encryption Algorithm, XTEA
. The cryptographic features are available as functions inside the database as well. SSL / TLS
connections are supported in the client-server mode, as well as when using the console application.
Two full text search
implementations are included, a native implementation and one using Lucene
.
A simple form of high availability is implemented: when used in the client-server mode, the database engine supports hot failover (this is commonly known as clustering). However, the clustering mode must be enabled manually after a failure.
The database supports protection against SQL injection
by enforcing the use of parameterized statements. In H2, this feature is called 'disabling literals'.
Since version 1.1.111, H2 in-memory database can run inside the Google App Engine
.
with a browser based console application are included, as well as command line tools to start and stop a server, backup and restore databases, and a command line shell tool.
Group was formed to continue work on the Hypersonic SQL code. The name H2 stands for Hypersonic 2, however H2 does not share code with Hypersonic SQL or HSQLDB. H2 is built from scratch.
Relational database management system
A relational database management system is a database management system that is based on the relational model as introduced by E. F. Codd. Most popular databases currently in use are based on the relational database model....
written in Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
. It can be embedded in Java applications or run in the client-server mode. The disk footprint (size of the jar file
JAR (file format)
In software, JAR is an archive file format typically used to aggregate many Java class files and associated metadata and resources into one file to distribute application software or libraries on the Java platform.JAR files are built on the ZIP file format and have the .jar file extension...
) is about 1 MB.
The software is available as open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...
software under modified versions of the Mozilla Public License
Mozilla Public License
The Mozilla Public License is a free and open source software license. Version 1.0 was developed by Mitchell Baker when she worked as a lawyer at Netscape Communications Corporation and version 1.1 at the Mozilla Foundation...
or the original Eclipse Public License
Eclipse Public License
The Eclipse Public License is an open source software license used by the Eclipse Foundation for its software. It replaces the Common Public License and removes certain terms relating to litigations related to patents....
. The modification of the MPL is a shorter file header and the license name.
Main features
A subset of the SQLSQL
SQL is a programming language designed for managing data in relational database management systems ....
(Structured Query Language) standard is supported. The main programming APIs are SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....
and JDBC, however the database also supports using the PostgreSQL
PostgreSQL
PostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...
ODBC driver by acting like a PostgreSQL
PostgreSQL
PostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...
server.
It is possible to create both in-memory tables, as well as disk-based tables. Tables can be persistent or temporary. Index types are hash table and tree for in-memory tables, and b-tree
B-tree
In computer science, a B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree is a generalization of a binary search tree in that a node can have more than two children...
for disk-based tables. All data manipulation operations are transactional
Database transaction
A transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...
. Table level locking and multiversion concurrency control
Multiversion concurrency control
Multiversion concurrency control , in the database field of computer science, is a concurrency control method commonly used by database management systems to provide concurrent access to the database and in programming languages to implement transactional memory.For instance, a database will...
are implemented. The 2-phase commit protocol is supported as well, but no standard API for distributed transactions is implemented. The security features of the database are: role based access rights, encryption of the password using SHA-256 and data using the AES
Advanced Encryption Standard
Advanced Encryption Standard is a specification for the encryption of electronic data. It has been adopted by the U.S. government and is now used worldwide. It supersedes DES...
or the Tiny Encryption Algorithm, XTEA
XTEA
In cryptography, XTEA is a block cipher designed to correct weaknesses in TEA. The cipher's designers were David Wheeler and Roger Needham of the Cambridge Computer Laboratory, and the algorithm was presented in an unpublished technical report in 1997...
. The cryptographic features are available as functions inside the database as well. SSL / TLS
Transport Layer Security
Transport Layer Security and its predecessor, Secure Sockets Layer , are cryptographic protocols that provide communication security over the Internet...
connections are supported in the client-server mode, as well as when using the console application.
Two full text search
Full text search
In text retrieval, full text search refers to techniques for searching a single computer-stored document or a collection in a full text database...
implementations are included, a native implementation and one using Lucene
Lucene
Apache Lucene is a free/open source information retrieval software library, originally created in Java by Doug Cutting. It is supported by the Apache Software Foundation and is released under the Apache Software License....
.
A simple form of high availability is implemented: when used in the client-server mode, the database engine supports hot failover (this is commonly known as clustering). However, the clustering mode must be enabled manually after a failure.
The database supports protection against SQL injection
SQL injection
A SQL injection is often used to attack the security of a website by inputting SQL statements in a web form to get a badly designed website in order to dump the database content to the attacker. SQL injection is a code injection technique that exploits a security vulnerability in a website's software...
by enforcing the use of parameterized statements. In H2, this feature is called 'disabling literals'.
Since version 1.1.111, H2 in-memory database can run inside the Google App Engine
Google App Engine
Google App Engine is a platform as a service cloud computing platform for developing and hosting web applications in Google-managed data centers. It virtualizes applications across multiple servers,...
.
Utilities
An embedded web serverWeb server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
with a browser based console application are included, as well as command line tools to start and stop a server, backup and restore databases, and a command line shell tool.
History
The development of the H2 database engine started in May 2004, but it was first published in December 2005. The database engine is written by Thomas Mueller. He also developed the Java database engine Hypersonic SQL. In 2001, the Hypersonic SQL project was stopped, and the HSQLDBHSQLDB
HSQLDB is a relational database management system written in Java. It has a JDBC driver and supports a large subset of SQL-92 and SQL:2008 standards. It offers a fast, small database engine which offers both in-memory and disk-based tables...
Group was formed to continue work on the Hypersonic SQL code. The name H2 stands for Hypersonic 2, however H2 does not share code with Hypersonic SQL or HSQLDB. H2 is built from scratch.
See also
- List of relational database management systems
- Comparison of relational database management systemsComparison of relational database management systemsThe following tables compare general and technical information for a number of relational database management systems. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up to date...
- Apache DerbyApache DerbyApache Derby is a relational database management system developed by the Apache Software Foundation that can be embedded in Java programs and used for online transaction processing. It has a 2 MB disk-space footprint.Apache Derby is developed as an open source project under the Apache 2.0 license...
- HSQLDBHSQLDBHSQLDB is a relational database management system written in Java. It has a JDBC driver and supports a large subset of SQL-92 and SQL:2008 standards. It offers a fast, small database engine which offers both in-memory and disk-based tables...