GithubHelp home page GithubHelp logo

Comments (5)

Okwori avatar Okwori commented on August 15, 2024 2

You can exclusively add this in the properties file in case your console has a preloaded JDBC URL from previous dev
spring.datasource.url=jdbc:h2:mem:testdb;

from spring-batch-example-1.

pathus90 avatar pathus90 commented on August 15, 2024 1

You can add this in the properties file

spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

spring.h2.console.enabled=true
spring.h2.console.path=/h2

spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update


The list of option which is used in the spring boot are

  • validate: validate the schema, makes no changes to the database.
  • update: update the schema.
  • create: creates the schema, destroying previous data.
  • create-drop: drop the schema at the end of the session
  • none: is all other cases.

So for avoiding the data lose you use update

from spring-batch-example-1.

HasmithaSaravanan avatar HasmithaSaravanan commented on August 15, 2024

same issue, tables are not created in h2.
not able to find the issue, please suggest the way forward.

from spring-batch-example-1.

srchaitanya avatar srchaitanya commented on August 15, 2024

If H2 is run as a server separately (either in local or in remote) then the following property need to be set
spring.batch.jdbc.initialize-schema=always
for spring boot BatchDataSourceScriptDatabaseInitializer.java to create tables

from spring-batch-example-1.

Aafaquegit avatar Aafaquegit commented on August 15, 2024

Yup application is running fine but not connecting to h2-console.
In the JDBC URL its showing jdbc:h2:~/test instead of jdbc:h2:mem:test.
Please help

from spring-batch-example-1.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.