This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes How to access HSQLDB in server mode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to access HSQLDB in server mode" Watch "How to access HSQLDB in server mode" New topic

How to access HSQLDB in server mode

Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
Hi, I wanted to use my application to connect to HSQLDB database running as a separate process via TCP. I'm not sure what changes needs to be made for this. Below are the steps I followed, but ended up with socket creation failure.

I started HSQLDB in server mode, running at and port 9001.

I made the hsqldb-ds.xml reflect like below


<?xml version="1.0" encoding="UTF-8"?> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:hsqldb:hsql://</connection-url> <driver-class>org.hsqldb.jdbcDriver</driver-class> <user-name>sa</user-name> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> <security-domain>HsqlDbRealm</security-domain> <prepared-statement-cache-size>32</prepared-statement-cache-size> <type-mapping>Hypersonic SQL</type-mapping> </local-tx-datasource> 9001 true default false true


I dropped this xml file in deploy folder of jboss default location (C:\sun\jboss\server\default\deploy) and started my JBoss

I'm recieving the below error


23:32:40,079 ERROR [STDERR] [Server@13d5f21]: [Thread[HSQLDB Server @13d5f21,5,jboss]]: run()/openServerSocket(): 23:32:40,089 ERROR [STDERR] Address already in use: JVM_Bind at Method) at at at at org.hsqldb.HsqlSocketFactory.createServerSocket(Unknown Source) at org.hsqldb.Server.openServerSocket(Unknown Source) at Source) at org.hsqldb.Server.access$000(Unknown Source) at org.hsqldb.Server$ Source)


Apparently from the error message, I could see socket connection is not established to DB server. However, I was able to connect to HSQLDB DatabaseManager externally. But having problem with JBoss.

I went and connected using DatabaseManager and I could see some new tables,

One more thing to mention here is I could not see any statement mentioning that DefaultDS is bound in server.log.

Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
I agree. Here's the link:
subject: How to access HSQLDB in server mode
It's not a secret anymore!