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
"no suitable driver" usually means that the syntax for the connection URL is incorrect.
It looks like you're not specifying a database name to connect to, should go something like
jdbc:hsqldb:hsql://serverName:port/DBname
As some answered before, this line of code solved the problem
Class.forName("org.hsqldb.jdbcDriver");
But my app is running in some tomcats but only in one installation I had to add this code.
when try to run datasource connectivity using static main method, first we need to run database connection. This we can achieve in eclipse as bellow.
1) open any IDE(Eclipse or RAD) after opening workspace by default IDE will be opened in JAVA prospective. Try to switch from java to database prospective in order to create datasource as well as virtual database connectivity.
2)in database prospective enter all the details like userName, Password and URL of the particular schema.
3)then try to run main method to access database.
This will resolve the "serverName undefined".
great I had the similar problem. The advice for all is to check jdbc url sintax
I think your HSQL URL is wrong. It should also include the database name,
so something like
jdbc:hsqldb:hsql://localhost/mydatabase
if mydatabase is the name of your DB (file). Not including this can (I'm not sure if it is the case here) confuse the parsing of the URL, which may lead to the DriverManagerDS thinking that your driver is not suitable (it is found, but it thinks it is not a good one)