Apache Derby is an open-source database written in
Java and can be deployed as either an in-process embedded database or a service.
Of course it's not going to have the performance of more popular open-source RDBMS's like
MySql or
Postgres, but I believe both of them have fees associated with redistribution (at least, they did last I looked at them).
If you are planning to use this database in a mission critical application, it would be wise to spend some money (Derby is supported by
Sun). If something goes wrong with your DB, it's worth it to have help solving the problem. Unless you like supporting other people's code, that is.