When you are changing the derby.database.classpath property, all classes loaded from database jar files are reloaded, even for a jar file that has not changed.

Remember that the user's classpath is searched first.

Any existing prepared statements will use the previously loaded classes unless they require class loading, in which case they will fail with a ClassNotFound error.

Cached objects do not match objects created with newly loaded classes. For example, an in-memory Customer object will not match a new Customer object if the Customer class has been reloaded, and it will raise a ClassCastException.

Related concepts
Requirements for dynamic changes