1

When trying to create a table with a Boolean field, I've come across a Derby error that prompts me to update the database version from 10.3 to 10.7. I've found this question which apparently contains the solution:

Tables for entities with boolean fields not created

but I can't see the syscs_get_database_property procedure in the syscs_util database. I've taken a quick look to Derby docs and I haven't found any reference to "update" or "version" in them.

I can't/don't want to rename/lose the database just to get the database updated, like the other thread proposes to fix the problem; also, I don't use JPA to create the schema. Is there any way to actually update the database (whichever that means)? I'm using the latest Java SE 8 Java DB/Derby JARs in NetBeans, defined as a library used in my desktop application, just changed from Java SE 7.

TIA

Community
  • 1
  • 1

2 Answers2

1

To upgrade your database to a newer version, follow the documentation here: http://db.apache.org/derby/docs/10.11/devguide/cdevupgrades.html

Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56
  • 1
    Thank you very much. I failed to find this in the docs because of two things: * I was searching for "update", not "upgrade". * I searched in Server and Administration Guide, in Tools and Utilities Guide and in Reference Manual, but I skipped Developer's Guide. The way I've performed the upgrade from Netbeans has been adding the property "upgrade" with the value "true" to the database connection in the Services window. – Ricardo Palomares Martínez Mar 05 '15 at 20:02
  • Just a friendly note, since I've lost another hour with this. After successfully upgrading the database to JavaDB version shipped with JDK 1.8.0_31-b13 (Derby 10.10.1.3), my app refused to run inside NetBeans. I got instead a version mismatch exception saying that the database had been created/updated with Derby 10.10. I've re-checked Tools -> Libraries in NetBeans only to confirm that JAVADB_DRIVER_LABEL library pointed to the updated JDK 1.8 dir (so, Derby 10.10 JARs). In the end, I've had to remove the library from the project and import it back to refresh it. – Ricardo Palomares Martínez Mar 05 '15 at 21:27
0

In your DB url just add this string

private static final String DB_URL = "jdbc:derby:mydatabase;upgrade=true";

Run this at the first time..There won't be no error anymore..

Replace it back to it pevious String

private static final String DB_URL = "jdbc:derby:mydatabase;create=true";

SilenceCodder
  • 2,874
  • 24
  • 28