KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nilostep > xlsql > jdbc > xlConnectionHSQLDB


1 /*(Header: NiLOSTEP / xlSQL)
2
3  Copyright (C) 2004 NiLOSTEP
4    NiLOSTEP Information Sciences
5    http://nilostep.com
6    nilo.de.roock@nilostep.com
7
8  This program is free software; you can redistribute it and/or modify it under
9  the terms of the GNU General Public License as published by the Free Software
10  Foundation; either version 2 of the License, or (at your option) any later
11  version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16  more details. You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software Foundation,
18  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */

20 /*
21  * xlConnectionHSQL.java
22  *
23  * Created on 5 juli 2004, 23:59
24  */

25 package com.nilostep.xlsql.jdbc;
26
27 import com.nilostep.xlsql.sql.*;
28
29
30 import java.sql.*;
31
32
33 /**
34  * DOCUMENT ME!
35  *
36  * @author Jim Caprioli
37  */

38 public class xlConnectionHSQLDB extends xlConnection {
39     /**
40      * Creates a new xlConnectionHSQLDB object.
41      *
42      * @param url DOCUMENT ME!
43      * @param sql_url DOCUMENT ME!
44      *
45      * @throws SQLException DOCUMENT ME!
46      */

47     public xlConnectionHSQLDB(String JavaDoc url, String JavaDoc sql_url)
48                        throws SQLException {
49         try {
50             w = xlSqlWriterFactory.create("hsqldb");
51             URL = url;
52             dbCon = DriverManager.getConnection(sql_url);
53             query = xlSqlSelectFactory.create("hsqldb", dbCon);
54             startup();
55             //xlsql = new xlHsqldb(datastore);
56
xlsql = xlSqlFactory.create("hsqldb", datastore, null);
57         } catch (Exception JavaDoc e) {
58             e.printStackTrace();
59             throw new SQLException(e.getMessage());
60         }
61     }
62
63     /**
64      * DOCUMENT ME!
65      *
66      * @throws Exception DOCUMENT ME!
67      */

68     public void shutdown() throws Exception JavaDoc {
69         dbCon.close();
70         closed = true;
71     }
72 }
Popular Tags