Resource constraints could help protect Derby from denial-of-service attacks. Resource constraints would be useful for throttling runaway users or enforcing quota licenses in multi-tenant situations, i.e., where an installation simultaneously runs multiple instances of the same application or several different applications. Resource constraints are discussed in the following email thread: http://apache-database.10148.n7.nabble.com/How-to-limit-Derby-size-on-Disk-td127797.html
The following file system constraints might be interesting:
1) Limits on the total space consumed by a database.
2) Limits on the total space consumed by an individual table.
3) Limits on the number of rows in an individual table.
4) Limits on the total space consumed by all tables owned by a given user or role.