I\'m trying to unit test (JUnit) a DAO i\'ve created. I\'m using Spring as my framework, my DAO (JdbcPackageDAO) extends SimpleJdbcDaoSupport. The testing class (JdbcPacka
If you look at your original connection string:
<property name="url" value="jdbc:hsqldb:hsql://localhost"/>
The Hypersonic docs suggest that you're missing an alias after localhost:
http://hsqldb.org/doc/guide/ch04.html
In order to have HSQLDB register itself, you need to access its jdbcDriver class. You can do this the same way as in this example.
Class.forName("org.hsqldb.jdbcDriver");
It triggers static initialization of jdbcDriver class, which is:
static {
try {
DriverManager.registerDriver(new jdbcDriver());
} catch (Exception e) {}
}
It might be that
hsql://localhost
can't be resolved to a file. Look at the sample program here:
Sample HSQLDB program
See if you can get that working first, and then see if you can take that configuration information and use it in the Spring bean configuration.
Good luck!