|
1 /* |
|
2 * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Sun designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Sun in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 * CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 * have any questions. |
|
24 */ |
|
25 |
|
26 package java.sql; |
|
27 |
|
28 /** |
|
29 * <p>Driver properties for making a connection. The |
|
30 * <code>DriverPropertyInfo</code> class is of interest only to advanced programmers |
|
31 * who need to interact with a Driver via the method |
|
32 * <code>getDriverProperties</code> to discover |
|
33 * and supply properties for connections. |
|
34 */ |
|
35 |
|
36 public class DriverPropertyInfo { |
|
37 |
|
38 /** |
|
39 * Constructs a <code>DriverPropertyInfo</code> object with a given |
|
40 * name and value. The <code>description</code> and <code>choices</code> |
|
41 * are intialized to <code>null</code> and <code>required</code> is initialized |
|
42 * to <code>false</code>. |
|
43 * |
|
44 * @param name the name of the property |
|
45 * @param value the current value, which may be null |
|
46 */ |
|
47 public DriverPropertyInfo(String name, String value) { |
|
48 this.name = name; |
|
49 this.value = value; |
|
50 } |
|
51 |
|
52 /** |
|
53 * The name of the property. |
|
54 */ |
|
55 public String name; |
|
56 |
|
57 /** |
|
58 * A brief description of the property, which may be null. |
|
59 */ |
|
60 public String description = null; |
|
61 |
|
62 /** |
|
63 * The <code>required</code> field is <code>true</code> if a value must be |
|
64 * supplied for this property |
|
65 * during <code>Driver.connect</code> and <code>false</code> otherwise. |
|
66 */ |
|
67 public boolean required = false; |
|
68 |
|
69 /** |
|
70 * The <code>value</code> field specifies the current value of |
|
71 * the property, based on a combination of the information |
|
72 * supplied to the method <code>getPropertyInfo</code>, the |
|
73 * Java environment, and the driver-supplied default values. This field |
|
74 * may be null if no value is known. |
|
75 */ |
|
76 public String value = null; |
|
77 |
|
78 /** |
|
79 * An array of possible values if the value for the field |
|
80 * <code>DriverPropertyInfo.value</code> may be selected |
|
81 * from a particular set of values; otherwise null. |
|
82 */ |
|
83 public String[] choices = null; |
|
84 } |