To get the DriverPropertyInfo object, request the JDBC driver from the driver manager:
java.sql.DriverManager.getDriver("jdbc:derby:"). getPropertyInfo(URL, Prop)
Do not request it from org.apache.derby.jdbc.EmbeddedDriver, which is only an intermediary class that loads the actual driver.
This method might return a DriverPropertyInfo object. In a Derby system, it consists of an array of database connection URL attributes. The most useful attribute is databaseName=nameofDatabase, which means that the object consists of a list of booted databases in the current system.
For example, if a Derby system has the databases toursDB and flightsDB in its system directory, all the databases in the system are set to boot automatically, and a user has also connected to a database A:/dbs/tours94, the array returned from getPropertyInfo contains one object corresponding to the databaseName attribute. The choices field of the DriverPropertyInfo object will contain an array of three Strings with the values toursDB, flightsDB, and A:/dbs/tours94. Note that this object is returned only if the proposed connection objects do not already include a database name (in any form) or include the shutdown attribute with the value true.
For more information about java.sql.Driver.getPropertyInfo, see "Offering Connection Choices to the User" in Chapter 8 of the Derby Developer's Guide.
Table of Contents