Connection Properties
The available connection properties can be retrieved with the getPropertyInfo method of the Driver class. This method returns an array with elements of type DriverPropertyInfo.
String connectionString = "jdbc: Url=http://localhost/woocommerce/;ConsumerKey=ck_ec52c76185c088ecaa3145287c8acba55a6f59ad;ConsumerSecret=cs_9fde14bf57126156701a7563fc87575713c355e5;:"; Driver driver = DriverManager.getDriver(connectionString); Properties info = new Properties(); DriverPropertyInfo[] attr = driver.getPropertyInfo(connectionString,info); for(int i=0;i<attr.length;i++){ System.out.println(attr[i].name); System.out.println(attr[i].description); System.out.println(attr[i].required); System.out.println(attr[i].value); String[] c = attr[i].choices; if(c != null) { for(String s: c) System.out.println(s); } }
The DriverPropertyInfo class has the following properties:
Property Name | Data Type | Description |
Name | String | The name of the connection property. |
Description | String | The description for the connection property. |
Required | boolean | Whether the connection property must be set to connect to WooCommerce. |
Choices | String[] | An array of the allowed values for the connection property. |
Value | String | The current value of the connection property or the default value if one is not set by the user. |