Cause of No suitable driver found for

后端 未结 15 1677
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 02:17

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

15条回答
  •  天命终不由人
    2020-12-14 02:59

    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)

提交回复
热议问题