Module java.sql
Package java.sql

Class DriverPropertyInfo

java.lang.Object
java.sql.DriverPropertyInfo

public class DriverPropertyInfo extends Object

用于建立连接的驱动程序属性。 DriverPropertyInfo 类仅对需要通过方法 getDriverProperties 与驱动程序进行交互以发现和提供连接属性的高级程序员感兴趣。

自版本:
1.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    String[]
    如果字段 DriverPropertyInfo.value 的值可以从特定值集中选择,则为可能值的数组;否则为 null。
    属性的简要描述,可能为 null。
    属性的名称。
    boolean
    如果在 Driver.connect 期间必须为此属性提供值,则 required 字段为 true;否则为 false
    value 字段根据提供给方法 getPropertyInfo 的信息、Java 环境和驱动程序提供的默认值的组合指定属性的当前值。
  • Constructor Summary

    Constructors
    Constructor
    Description
    使用给定名称和值构造一个 DriverPropertyInfo 对象。
  • Method Summary

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      public String name
      属性的名称。
    • description

      public String description
      属性的简要描述,可能为 null。
    • required

      public boolean required
      如果在 Driver.connect 期间必须为此属性提供值,则 required 字段为 true;否则为 false
    • value

      public String value
      value 字段根据提供给方法 getPropertyInfo 的信息、Java 环境和驱动程序提供的默认值的组合指定属性的当前值。如果不知道值,则此字段可能为 null。
    • choices

      public String[] choices
      如果字段 DriverPropertyInfo.value 的值可以从特定值集中选择,则为可能值的数组;否则为 null。
  • Constructor Details

    • DriverPropertyInfo

      public DriverPropertyInfo(String name, String value)
      使用给定名称和值构造一个 DriverPropertyInfo 对象。 descriptionchoices 初始化为 nullrequired 初始化为 false
      参数:
      name - 属性的名称
      value - 当前值,可能为 null