Here you can find the source of createHSQLDBConnection(String hsqldbName)
Parameter | Description |
---|---|
hsqldbName | the file path to the HSQL database (file system). See HSQL documentation at http://hsqldb.org/doc/2.0/guide/running-chapt.html |
public static Connection createHSQLDBConnection(String hsqldbName)
//package com.java2s; //License from project: LGPL import java.sql.*; public class Main { /**//from w ww . j av a 2 s . com * Establish a database connection to a HSQL database (file system) * @param hsqldbName the file path to the HSQL database (file system). See HSQL documentation at http://hsqldb.org/doc/2.0/guide/running-chapt.html * @return a database connection */ public static Connection createHSQLDBConnection(String hsqldbName) { try { Class.forName("org.hsqldb.jdbcDriver"); Connection conn = DriverManager.getConnection( "jdbc:hsqldb:file:" + hsqldbName, // filenames "sa", // username ""); // pwd return conn; } catch (Exception e) { System.err .println("ERROR SEVERE - Cannot establish database connection to JATR internal database. Please check your " + "claspath to HSQL library, and database path: " + hsqldbName); e.printStackTrace(); System.exit(1); } return null; } }