Embedded spatial database for Java?

You could try Hatbox (http://hatbox.sourceforge.net/derbyquickstart.html) from the web page:

Hatbox has two distinct parts: the core library and a Geotools DataStore. The core library can be used entirely independently of the Geotools DataStore. This quick start will use only the core library to get data into your new Hatbox spatialized table and to issue spatial queries on it. It will focus on using Hatbox with JavaDB (Sun's packaging of Apache Derby) simply because it comes as part of a Sun JDK 6 install.


GeoDB is exactly what you need. It's an extension to H2 based on JTS. There also is a Hibernate dialect for geodb (link updated) (http://www.hibernatespatial.org/hibernate-spatial-h2-geodb/).