upgrade=true attribute
Derby Reference Manual
352
Example
-- enable tracing on a new database
jdbc:derby://localhost:1527/
mydb;create=true;traceFile=trace.out;traceLevel=65
upgrade=true attribute
Function
Upgrades a database that was created using an earlier version of Derby to the current
version of Derby, then connects to it. If the database does not exist, an error appears in
the error log and the connection attempt fails with an SQLException indicating that the
database cannot be found.
This operation performs a full upgrade, as defined in "Upgrading a database" in the
Derby Developer's Guide. For more information about upgrades, see the other topics
under "Upgrades" in the Derby Developer's Guide.
For a database for which authentication and SQL authorization are both enabled, only the
can perform a full upgrade. See also "Enabling user authentication" and
"Setting the SQL standard authorization mode" in the Derby Developer's Guide for more
information.
Note: You cannot perform a full upgrade on a database already booted in soft upgrade
mode. If a database is already booted in soft upgrade mode, the upgrade=true attribute
will have no effect. If a database is already booted in soft upgrade mode, you can
first shutdown the database with the
attribute and then connect with
upgrade=true to perform the upgrade.
Combining with other attributes
You must specify a databaseName (after the subprotocol in the database connection
URL) or a
attribute with this attribute.
You cannot combine this attribute with the
Example
jdbc:derby:sampleDB;upgrade=true
jdbc:derby:;databaseName=sampleDB;upgrade=true;
user=userName attribute
Specifies a valid user name for the system, specified with a password. A valid user name
and password are required when user authentication is turned on.
Combining with other attributes
Use in conjunction with the
Example
The following database connection URL connects the user jill to toursDB:
jdbc:derby:toursDB;user=jill;password=toFetchAPail
Creating a connection without specifying attributes
If no attributes are specified, you must specify a databaseName.