1 /*
2 * PROJECT : DAR Runtime and Tools
3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org
4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE
5 * Version 2.1, February 1999
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 package org.enableit.db;
22
23 import org.apache.log4j.Logger;
24
25
26 /***
27 * Base class for utilities that need to connect to database.
28 */
29 public abstract class AbstractDBUtility {
30 /***
31 * Define a static Logger instance for logging.
32 */
33 private static Logger logger = Logger.getLogger(AbstractDBUtility.class);
34
35 // Properties -----------------------------------------------------------------
36
37 /***
38 * The JDBC driver's class name.
39 */
40 protected String driver;
41
42 /***
43 * The database URL to connect to.
44 */
45 protected String url;
46
47 /***
48 * Username to use when connecting to the database.
49 */
50 protected String userid;
51
52 /***
53 * Password to use when connecting to the database.
54 */
55 protected String password = "";
56
57 // Constructors ---------------------------------------------------------------
58
59 /***
60 * Default Constructor.
61 */
62 public AbstractDBUtility() {
63 }
64
65 /***
66 * Export the schema identified by the provided connection parameters.
67 * @param driver Name of JDBC driver class.
68 * @param url The JDBC datasource's URL.
69 * @param userid The user id to connect with.
70 * @param password The password to connect with.
71 */
72 public void setConnectionProperties(String driver, String url,
73 String userid, String password) {
74 this.driver = driver;
75 this.url = url;
76 this.userid = userid;
77 this.password = password;
78 }
79 }
This page was automatically generated by Maven