RSS Feed for This PostCurrent Article

Alternative for HSQLDB and Derby

H2 is another Java SQL database that you can use other than HSQLDB or Derby. The main features of H2 are:

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1 MB jar file size

Main Features

  • Very fast database engine
  • Open source
  • Written in Java
  • Supports standard SQL, JDBC API
  • Embedded and Server mode, Clustering support
  • Strong security features
  • The PostgreSQL ODBC driver can be used
  • Multi version concurrency
Additional Features
  • Disk based or in-memory databases and tables, read-only database support, temporary tables
  • Transaction support (read committed and serializable transaction isolation), 2-phase-commit
  • Multiple connections, table level locking
  • Cost based optimizer, using a genetic algorithm for complex queries, zero-administration
  • Scrollable and updatable result set support, large result set, external result sorting, functions can return a result set
  • Encrypted database (AES or XTEA), SHA-256 password encryption, encryption functions, SSL
SQL Support
  • Support for multiple schemas, information schema
  • Referential integrity / foreign key constraints with cascade, check constraints
  • Inner and outer joins, subqueries, read only views and inline views
  • Triggers and Java functions / stored procedures
  • Many built-in functions, including XML and lossless data compression
  • Wide range of data types including large objects (BLOB/CLOB) and arrays
  • Sequence and autoincrement columns, computed columns (can be used for function based indexes)
  • ORDER BY, GROUP BY, HAVING, UNION, LIMIT, TOP
  • Collation support, users, roles
  • Compatibility modes for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL.
Security Features
  • Includes a solution for the SQL injection problem
  • User password authentication uses SHA-256 and salt
  • For server mode connections, user passwords are never transmitted in plain text over the network (even when using insecure connections; this only applies to the TCP server and not to the H2 Console however; it also doesn’t apply if you set the password in the database URL)
  • All database files (including script files that can be used to backup data) can be encrypted using AES-256 and XTEA encryption algorithms
  • The remote JDBC driver supports TCP/IP connections over SSL/TLS
  • The built-in web server supports connections over SSL/TLS
  • Passwords can be sent to the database using char arrays instead of Strings
Other Features and Tools
  • Small footprint (smaller than 1 MB), low memory requirements
  • Multiple index types (b-tree, tree, hash)
  • Support for multi-dimensional indexes
  • CSV (comma separated values) file support
  • Support for linked tables, and a built-in virtual ‘range’ table
  • EXPLAIN PLAN support, sophisticated trace options
  • Database closing can be delayed or disabled to improve the performance
  • Web-based Console application (translated to many languages) with autocomplete
  • The database can generate SQL script files
  • Contains a recovery tool that can dump the contents of the database
  • Support for variables (for example to calculate running totals)
  • Automatic re-compilation of prepared statements
  • Uses a small number of database files
  • Uses a checksum for each record and log entry for data integrity
  • Well tested (high code coverage, randomized stress tests)


Trackback URL


Sorry, comments for this entry are closed at this time.