Installation and Testing of Hypersonic DB from Java

1. Download:
http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_2_2/hsqldb-2.2.8.zip/download
2. Install:
Unzip the hsqldb-2.2.8.zip to proper location, for example
/usr/local/hsqldb
3. Configure:
i) Open Configuration GUI using below command,
/usr/local/hsqldb/lib/java -jar hsqldb.jar
ii) Provide location for file based database, for example 
/Users/santoshlg/testdb

iii) To use hsqldb from the Eclipse project, add hsqldb.jar in the Eclipse Project Library reference,
4.Testing:
i) Connect to db GUI Console using above configuration to get below Database Manager GUI
ii) Create sample table CUSTOMER by using GUI Editor 
(Editor appears after successful connection as per above step i) 
CREATE TABLE CUSTOMER (
            LAST_NAME VARCHAR(60),
            FIRST_NAME VARCHAR(60),
            ACCOUNT_ID VARCHAR(10)
)

iii) Insert 2 test records
INSERT INTO CUSTOMER
            (LAST_NAME, FIRST_NAME,ACCOUNT_ID)
            VALUES
            ('HONDA','YUKI','A-1001');
INSERT INTO CUSTOMER
            (LAST_NAME, FIRST_NAME,ACCOUNT_ID)
            VALUES
            ('SUZUKI','ICHIRO','A-1002');

iv) Use below Java test to confirm the working 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class TestHSQLDB {
public static void main(String[] args) throws SQLException {
 
Connection conn = null;
PreparedStatement prepStmt = null;
ResultSet rs = null;
 
 try {
  Class.forName("org.hsqldb.jdbc.JDBCDriver");
  conn = 
  DriverManager.getConnection("jdbc:hsqldb:file:/Users/santoshlg/testdb", "SA", "");

            String selectStatement =
                "select * from Customer where ACCOUNT_ID = ?";
            prepStmt = conn.prepareStatement(selectStatement);
            prepStmt.setString(1, "A-1001");
            rs = prepStmt.executeQuery();

            while (rs.next()) {
                String title = rs.getString("LAST_NAME");
                System.out.println(title);
            }

  } catch (Exception e) {
      System.err.println("ERROR: failed to load HSQLDB JDBC driver.");
      e.printStackTrace();
  } finally {
            rs.close();
            prepStmt.close();
  conn.close();
  }
}
}

5. Output:
HONDA