Path: blob/master/src/java.sql/share/classes/java/sql/DriverPropertyInfo.java
41153 views
/*1* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.sql;2627/**28* <p>Driver properties for making a connection. The29* {@code DriverPropertyInfo} class is of interest only to advanced programmers30* who need to interact with a Driver via the method31* {@code getDriverProperties} to discover32* and supply properties for connections.33*34* @since 1.135*/3637public class DriverPropertyInfo {3839/**40* Constructs a {@code DriverPropertyInfo} object with a given41* name and value. The {@code description} and {@code choices}42* are initialized to {@code null} and {@code required} is initialized43* to {@code false}.44*45* @param name the name of the property46* @param value the current value, which may be null47*/48public DriverPropertyInfo(String name, String value) {49this.name = name;50this.value = value;51}5253/**54* The name of the property.55*/56public String name;5758/**59* A brief description of the property, which may be null.60*/61public String description = null;6263/**64* The {@code required} field is {@code true} if a value must be65* supplied for this property66* during {@code Driver.connect} and {@code false} otherwise.67*/68public boolean required = false;6970/**71* The {@code value} field specifies the current value of72* the property, based on a combination of the information73* supplied to the method {@code getPropertyInfo}, the74* Java environment, and the driver-supplied default values. This field75* may be null if no value is known.76*/77public String value = null;7879/**80* An array of possible values if the value for the field81* {@code DriverPropertyInfo.value} may be selected82* from a particular set of values; otherwise null.83*/84public String[] choices = null;85}868788