connecting to h2 database from java

Java
Connection conn = DriverManager.getConnection ("jdbc:h2:~/test", "sa",""); 

Source

Also in Java: