• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

How to access to in-memory HSQL db in Spring boot app?  RSS feed

 
Ranch Hand
Posts: 1729
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am running  the spring-petclinic code here at https://github.com/spring-projects/spring-petclinic
This application retrieves pets, owner, vets ... data from an embedded HSQL database.
There is an application.properties file with these config without specifying any username or password:


database = hsqldb
spring.datasource.schema=classpath*:db/${database}/schema.sql
spring.datasource.data=classpath*:db/${database}/data.sql
...



The pom.xml :


<!-- Databases - Uses HSQL by default -->
   <dependency>
     <groupId>org.hsqldb</groupId>
     <artifactId>hsqldb</artifactId>
     <scope>runtime</scope>
   </dependency>
   <dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <scope>runtime</scope>
</dependency>
....



I am sure the HSQL database is embedded in this Spring boot application. But I don't know how to access it.
The author said I am not supposed to ask questions from Github. That is why I ask this question here.
 
Himai Minh
Ranch Hand
Posts: 1729
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I cannot access to the spring boot's embedded HSQL database directly through HySQL database engine.
I can only view the data from this embedded database through the Thymleaf pages in the spring boot project in the same virtual machine.

In a similar situation , I use H2 embedded DB, I can only access it through localhost:<port number>/h2-console. I cannot even access it through the DB connection in IntelliJ.

 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!