Announcement Announcement Module
Collapse
No announcement yet.
Troubles with a connection using HSQL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Troubles with a connection using HSQL

    Hi all, i am testing a Spring application with a HSQL database placed in c:/springappBisBD/db/test
    It works fine.
    Code of the bean:
    Code:
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
          <property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
          <property name="url">
            <value>jdbc&#58;hsqldb&#58;c&#58;/springappBisBD/db/test</value> 
          </property>
          <property name="username"><value>sa</value></property>
          <property name="password"><value></value></property>
    </bean>
    The problems arise when i try to change the url property
    Code:
    <value>jdbc&#58;hsqldb&#58;http&#58;//127.0.0.1/db/test</value>
    I am using "HSQL Database Engine Standalone"

    The error is the following:
    Code:
    org.springframework.jdbc.CannotGetJdbcConnectionException&#58; Could not get JDBC connection; nested exception is java.sql.SQLException&#58; socket creation error
    	org.springframework.jdbc.datasource.DataSourceUtils.getConnection&#40;DataSourceUtils.java&#58;155&#41;
    	org.springframework.jdbc.datasource.DataSourceUtils.getConnection&#40;DataSourceUtils.java&#58;128&#41;
    	org.springframework.jdbc.core.JdbcTemplate.execute&#40;JdbcTemplate.java&#58;348&#41;
    	org.springframework.jdbc.core.JdbcTemplate.query&#40;JdbcTemplate.java&#58;403&#41;
    	org.springframework.jdbc.core.JdbcTemplate.query&#40;JdbcTemplate.java&#58;431&#41;
    	org.springframework.jdbc.core.JdbcTemplate.query&#40;JdbcTemplate.java&#58;452&#41;
    	org.springframework.jdbc.object.SqlQuery.execute&#40;SqlQuery.java&#58;114&#41;
    	org.springframework.jdbc.object.SqlQuery.execute&#40;SqlQuery.java&#58;124&#41;
    	org.springframework.jdbc.object.SqlQuery.execute&#40;SqlQuery.java&#58;139&#41;
    	db.ProductManagerDaoJdbc.getProductList&#40;ProductManagerDaoJdbc.java&#58;32&#41;
    	bus.ProductManager.getProducts&#40;ProductManager.java&#58;32&#41;
    	web.SpringappController.handleRequest&#40;SpringappController.java&#58;42&#41;
    	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle&#40;SimpleControllerHandlerAdapter.java&#58;44&#41;
    	org.springframework.web.servlet.DispatcherServlet.doService&#40;DispatcherServlet.java&#58;584&#41;
    	org.springframework.web.servlet.FrameworkServlet.serviceWrapper&#40;FrameworkServlet.java&#58;368&#41;
    	org.springframework.web.servlet.FrameworkServlet.doGet&#40;FrameworkServlet.java&#58;319&#41;
    	javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;697&#41;
    	javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;810&#41;
    Any help will be wellcome
    Thanks in advance

  • #2
    Running HSQL in a standalone mode (as in your first example) makes it run in the same JVM as your application. In that case you use jdbc:hsqldb:<directory>/databse.

    In your second example it seems you're trying to connect to the HSQL server (on the same machine, though). It needs to be started first, and your url most likelly won't be http://something. See the following URL for more details:

    http://hsqldb.sourceforge.net/doc/gu...01.html#N1012C

    Comment

    Working...
    X