Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3982680
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:33:24+00:00 2026-05-20T05:33:24+00:00

I am using hsqldb standalone as my database. i have a hsqldb.jar(hsqldb-2.0.0) which i

  • 0

I am using hsqldb standalone as my database. i have a hsqldb.jar(hsqldb-2.0.0) which i added on my project build path so my project will find out where is my hsqldb.jar. i am using spring with these. my spring bean is:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <bean id="sqlMapClient"
        class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">

        <property name="dataSource">
            <ref local="adapterDataSource" />
        </property>


        <property name="configLocation"
            value="classpath:/com/hsqldb/example/dao/ibatis/SqlMapConfig.xml" />


    </bean>

    <bean id="adapterDataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
        <property name="url" value="data/db/hsqldb.jar" />
        <property name="username" value="SA" />
        <property name="password" value="password" />
    </bean>
    <bean id="testingDao" class="com.hsqldb.example.dao.TestingDao"
        init-method="setTestDao" depends-on="moodleAuthenticationDetails">
        <property name="sqlMapClient">
            <ref local="sqlMapClient" />
        </property>

    </bean>
    <bean id="moodleAuthenticationDetails"
        class="com.hsqldb.example.HsqlDBAuthentication"></bean>
</beans> 

and i have a method which will return me a data source which is as below :

public static DataSource getDataSource(String filePath){
        String url;
        //url="jdbc:hsqldb:file:"+filePath;
        url = "jdbc:hsqldb:file:D:/EclipseWorskpace/ew-pg/lmexadapter/hsqldb-example/src/main/webapp/WEB-INF/data/db/hsqldb.jar";
        BasicDataSource basicDataSource = new BasicDataSource();
        basicDataSource.setUsername("SA");
        basicDataSource.setPassword("password");
        basicDataSource.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
//      basicDataSource.setUrl("jdbc:mysql://IP/moodle");
        basicDataSource.setUrl(url);
        System.out.println("$$$$$$$$ URL is : " + url);
        return basicDataSource;
    }

but while running my test case by junit test it’s giving me an exception :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.hsqldb.jdbcDriver' for connect URL 'data/db/hsqldb.jar'
    at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1273)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1192)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
    at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:213)
    ... 35 more
Caused by: java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(DriverManager.java:264)
    at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1266)
    ... 39 more

please help to resolve this.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:33:26+00:00Added an answer on May 20, 2026 at 5:33 am

    The BasicDataSource url property in your Spring config should not be the path to your jar. See some examples of working Spring configs here.

    (The DataSource class you’ve written won’t do anything unless you make Spring aware of it. But you don’t have to write such a class — just fix the url property in your config.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Spring Batch with an HSQLDB in-memory database for Spring Batch metadata. My
I am using Spring's embedded-database (default DB is HSQLDB) for running some unit tests.
I have a simple Java web application using HSQLDB embedded database. The application is
Currently I am using HSQLDB 2.0.0 for my project. I have a table with
I have been using Hibernate + HSQLDB on my desktop for developing a database
I'm using HSQLDB for testing. The database is created from spring by scanning the
I'm using hsqldb for my Spring-based java webapp. I put database files (mydb.lck, mydb.properties,..)
i am using hsqldb as database. i create LmexPostParamDao which has a method insertLmexPostParam(NameValuePostParamVO
Situation: I have a static Database class, using HSQLDB and I want to use
We have a setup where we are using an embedded HSQLDB for backing Hibernate/JPA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.