0

I am using in memory hsqldb in my spring boot project. Here is a sample of my appliction.properties

spring.datasource.url=jdbc:hsqldb:mem  
spring.datasource.username=  
spring.datasource.password=  
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver  

When I start my application, it creates couple of files like mem.script, mem.log in my project home directory.
mem.log has all the sql statements it has excuted on the database. And it gets updated whenever some action is triggered from my repository class. Functionality as a whole is working, I can even query from this hsqldb and it works.

But for some debugging purpose I want to connect to this db through some db client (DBVisualizer). When I tried connecting(DB Type : HSQLDB Embedded) using this mem.log file, I was successfully connected, but cannot see any of my tables there.

I even tried setting up a server in my application as mentioned here,
How to start HSQLDB in server mode from Spring boot application

Even in this case I can connect from DBVisualizer(DB Type : HSQLDB Server) but cannot see any tables.

Please let me know if I am missing something.

Thanks

Community
  • 1
  • 1
pvpkiran
  • 25,582
  • 8
  • 87
  • 134

1 Answers1

0

First of all, the url you are using is too similar to an all-in-memory database with no files (jdbc:hsqldb:mem:anyname) but it is not an in-memory URL.

Follow the the instructions for the server mode in the question you linked to. Report your version of the configuration if you cannot see the tables. Note the configuration parameters that I quote below:

<prop key="server.database.0">mem:testdb</prop>
<prop key="server.dbname.0">testdb</prop><!--DB name for network connection-->

and connect with this URL from DBVisualiser

jdbc:hsqldb:hsql://localhost/testdb 
fredt
  • 24,044
  • 3
  • 40
  • 61
  • I am using in memory database. And hence the url is like jdbc:hsqldb:mem. I want to connect to this in memory database from a db tool. – pvpkiran Mar 22 '17 at 12:17
  • No, you are using a file database. An in-memoy URL has a colon and a name after `jdbc:hsqldb:mem`. I'll update the answer. – fredt Mar 22 '17 at 12:22
  • Hi, Thanks for the support. But unfortunately I am still not able to see the tables. One other interesting thing is I could only connect to this database from DBVisualizer with username as 'sa' and empty password. Without this I was not able to connect. This is strange because i have not specified any username or password in my properties file. – pvpkiran Mar 22 '17 at 19:24
  • Default username and password are SA and empty. – fredt Mar 23 '17 at 14:52
  • Thanks. But I still don't see any of my tables :( – pvpkiran Mar 23 '17 at 19:35