DriverPropertyInfo[] java.sql.Driver.getPropertyInfo(String url, Properties info) : Driver « Database SQL JDBC « Java






DriverPropertyInfo[] java.sql.Driver.getPropertyInfo(String url, Properties info)

   

import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.DriverPropertyInfo;

public class Main {
  public static void main(String[] argv) throws Exception {
    String driverName = "org.gjt.mm.mysql.Driver";
    Class.forName(driverName);

    String url = "jdbc:mysql://a/b";
    Driver driver = DriverManager.getDriver(url);

    DriverPropertyInfo[] info = driver.getPropertyInfo(url, null);
    for (int i = 0; i < info.length; i++) {
      String name = info[i].name;
      boolean isRequired = info[i].required;
      String value = info[i].value;
      String desc = info[i].description;
      String[] choices = info[i].choices;
    }
  }
}

   
    
    
  








Related examples in the same category

1.Get Driver Property Info
2.Get Driver Name
3.int java.sql.Driver.getMajorVersion()
4.int java.sql.Driver.getMinorVersion()
5.boolean java.sql.Driver.jdbcCompliant()
6.Enumeration java.sql.DriverManager.getDrivers()
7.Get Driver Version
8.JDBC Driver Information
9.Loading a JDBC Driver: call Class.forName() within the code
10.Listing All Loaded JDBC Drivers and gets information about each one.
11.Enable JDBC logging
12.JDBC driver url