Put Derby first in your classpath

The structure of your classpath can affect Derby startup time and the time required to load a particular class.

The classpath is searched linearly, so locate Derby's libraries at the beginning of the classpath so that they are found first. If the classpath first points to a directory that contains multiple files, booting Derby can be very slow.

Related concepts
Use prepared statements with substitution parameters
Create indexes, and make sure they are being used
Ensure that table statistics are accurate
Increase the size of the data page cache
Tune the size of database pages
Avoid expensive queries
Use the appropriate getXXX and setXXX methods for the type
Tune database booting/class loading
Avoid inserts in autocommit mode if possible
Improve the performance of table functions
Configure Derby to use an in-memory database
Increase the concurrency of sequences
Shut down the system properly