Well, Derby is focused on ease of administration and embedded use, and this includes seriously painless upgrade.
There are two types of upgrade: soft upgrade and full upgrade.
With soft upgrade, you can use a new driver to work with a database created under a previous version, but older drivers will still be able to work with the database too -- the database itself is not upgraded to the newer version/format.
This is convenient if you want to just try things out, or if you have a mixed environment where some users are still using older versions of the driver.
The drawback of this approach is that if there are new features in the newer version that rely on a new database format or new system metadata, etc., then you can't take advantage of those new features. For example, Derby 10.3 has added features for security, SQL, and administration that won't work with an older database.
That is where full upgrade comes in.
You don't need to do anything crazy like export all your data, create a new database, and recreate your tables and load your data. All you have to do is set the "upgrade" property to "true" when you connect to the database.
There are two ways to do this. You can set it as a property directly in the URL, e.g
"jdbc:derby:travel;upgrade=true"or you can add it as a property when you get the connection, e.g.
One important caveat: if you have created a database with a non-GA version of Java DB you can not upgrade it. This is because there is no commitment to support upgrade from what is basically an experimental database. All this mean is, please don't deploy a production solution using Java DB with a beta version of Java DB.
String dbURL = "jdbc:derby:travel";
Properties connProps = new Properties();
Connection conn = DriverManager.getConnection(dbURL, connProps);