// Connecting to a Hypersonic HSQLDB database via JDBC

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

private Connection conn;

public void init()
   {
   // instantiate the SLSQLDB JDBC driver. Using ClassForName/newInstance
   // rather than new means the driver need not be present at compile time.
   // Oddly, we need not retain a reference to the Driver object,
   // or even do a newInstance().

   try
      {
      Class.forName( "org.hsqldb.jdbcDriver" );
      }
   catch ( Exception e )
      {
      System.out.println( "can't load Hypersonic JDBC driver: " + e.getMessage() );
      }
   try
      {
      // log on to the allaboutsquirrels database
      conn = DriverManager.getConnection( "jdbc:hsqldb:hsql://aserver.com/allaboutsquirrels", "myuserid", "sesame");
      }
   catch ( SQLException e )
      {
      System.out.println( "can't connect to HSLQDB: " + e.getMessage() );
      }
   }
...

// create the shell into which you can pour an SQL command.
Statement stmt = conn.createStatement();