0

I am very new to Spring Batch. Tried the getting started example from spring doc. using spring-boot-starter-parent(1.5.2.RELEASE). Trying to understand where can I see the data that is inserted using this "Person" table in hsql. and also where can I see the Meta data tables for this example after execution. Please help me to understand this.

user12
  • 239
  • 2
  • 6
  • 18

1 Answers1

0

By default, Spring Boot uses an embedded database (H2, HSQL, Derby) accordingly to your dependencies.

H2 provides a great web console to view the state of your database. You'll find more informations here : https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-sql-h2-console

If you'd like to stay with HSQL, please have a look at this answer : https://stackoverflow.com/a/8880390/8232755

Thoomas
  • 2,150
  • 2
  • 19
  • 33
  • Hi Thoomas, Thanks for the answer. Can I see the results persisted even after batch execution complete? why i am asking is my app is simple main method execution stand alone app. or it will work only with web app? – user12 Jun 30 '17 at 12:27
  • I'm afraid you won't be able to view the persisted results because the database vanishes when JVM exits at the end of the batch. But you can switch to "file mode" or "server mode", and configure the application.properties file to connect to the DB (ex for file mode : `spring.datasource.url=jdbc:hsqldb:file:/home/me/testdb`). – Thoomas Jun 30 '17 at 12:46
  • @Swarop: the default (mode) for an embedded database is "in-memory" (so, no persistence, after `System.exit()`!) ... but h2 can easily be switched into "file" or "server" mode ... [h2 guide](http://hsqldb.org/doc/2.0/guide/index.html) ..and it "should" work as in standalone as in web applications. – xerx593 Jun 30 '17 at 12:46
  • 1
    Thank you @xerx593 . That worked. I have used hsql server mode, which has persisted the data. – user12 Jul 23 '17 at 07:58