01: /*
02: * Copyright (C) 2004 Giuseppe MANNA
03: *
04: * This file is part of FreeReportBuilder
05: *
06: * FreeReportBuilder is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package it.frb;
23:
24: import java.util.*;
25: import java.io.*;
26:
27: public class ConnDefinition {
28: private static final String DRIVER_ID = "driver_id";
29: private static final String URL = "url";
30: private static final String USER = "user";
31: private static final String PASSWORD = "password";
32: private static final String CATALOG = "catalog";
33:
34: private String sDriverName = null;
35: private String sURL = null;
36: private String sUser = null;
37: private char[] sPassword = null;
38: private String sCatalog = null;
39:
40: //-------------------------------------------------------------------------//
41:
42: public ConnDefinition() {
43: super ();
44: }
45:
46: public ConnDefinition(String sDriverId, String sURL, String sUser,
47: String sPassword, String sCatalog) {
48: setDriverName(sDriverName);
49: setURL(sURL);
50: setUser(sUser);
51: setPassword(sPassword);
52: setCatalog(sCatalog);
53: }
54:
55: public String getDriverName() {
56: return this .sDriverName;
57: }
58:
59: public String getURL() {
60: return this .sURL;
61: }
62:
63: public String getUser() {
64: return this .sUser;
65: }
66:
67: public String getPassword() {
68: return this .sPassword == null ? null : String
69: .valueOf(this .sPassword);
70: }
71:
72: public String getCatalog() {
73: return this .sCatalog;
74: }
75:
76: public void setDriverName(String s) {
77: this .sDriverName = (s == null) ? null : s.trim();
78: }
79:
80: public void setURL(String s) {
81: this .sURL = (s == null) ? null : s.trim();
82: }
83:
84: public void setUser(String s) {
85: this .sUser = s;
86: } // Can start and/or end with spaces and be null
87:
88: public void setPassword(String s) {
89: this .sPassword = s == null ? null : s.toCharArray();
90: } // Can start and end with spaces and be null
91:
92: public void setCatalog(String s) {
93: this.sCatalog = (s == null) ? null : s.trim();
94: }
95: }
|