01: /*
02: *
03: * textFile/tinySQL JDBC driver
04: *
05: * A lot of this code is based on or directly taken from
06: * George Reese's (borg@imaginary.com) mSQL driver.
07: *
08: * So, it's probably safe to say:
09: *
10: * Portions of this code Copyright (c) 1996 George Reese
11: *
12: * The rest of it:
13: *
14: * Copyright 1996, Brian C. Jepson
15: * (bjepson@ids.net)
16: *
17: * $Author: davis $
18: * $Date: 2004/12/18 21:27:36 $
19: * $Revision: 1.1 $
20: *
21: * This library is free software; you can redistribute it and/or
22: * modify it under the terms of the GNU Lesser General Public
23: * License as published by the Free Software Foundation; either
24: * version 2.1 of the License, or (at your option) any later version.
25: *
26: * This library is distributed in the hope that it will be useful,
27: * but WITHOUT ANY WARRANTY; without even the implied warranty of
28: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29: * Lesser General Public License for more details.
30: *
31: * You should have received a copy of the GNU Lesser General Public
32: * License along with this library; if not, write to the Free Software
33: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34: *
35: */
36:
37: package com.sqlmagic.tinysql;
38:
39: import java.sql.Connection;
40: import java.sql.DriverPropertyInfo;
41: import java.sql.SQLException;
42: import java.sql.Driver;
43: import java.util.Properties;
44:
45: public class textFileDriver extends tinySQLDriver {
46:
47: /*
48: *
49: * Instantiate a new textFileDriver(), registering it with
50: * the JDBC DriverManager.
51: *
52: */
53: static {
54: try {
55: java.sql.DriverManager.registerDriver(new textFileDriver());
56: } catch (Exception e) {
57: e.printStackTrace();
58: }
59: }
60:
61: /**
62: *
63: * Constructs a new textFileDriver
64: *
65: */
66: public textFileDriver() {
67: super ();
68: }
69:
70: /**
71: *
72: * returns a new textFileConnection object, which is cast
73: * to a tinySQLConnection object.
74: *
75: * @exception SQLException when an error occurs
76: * @param user the username - currently unused
77: * @param url the url to the data source
78: * @param d the Driver object.
79: *
80: */
81: public tinySQLConnection getConnection(String user, String url,
82: Driver d) throws SQLException {
83:
84: return (tinySQLConnection) new textFileConnection(user, url, d);
85: }
86:
87: }
|