Source Code of Master Spring Data JPA with Hibernate: E-Commerce Project Udemy course
rameshmf / spring-boot-jpa-course Goto Github PK
View Code? Open in Web Editor NEWSource Code of Learn Spring Data JPA with Hibernate Course
Source Code of Learn Spring Data JPA with Hibernate Course
Source Code of Master Spring Data JPA with Hibernate: E-Commerce Project Udemy course
How is it possible to use h2 instead of MySql?
I have tried setting the dependency in pom.xml and set the according values on application.properties
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
and I receive the following error
2023-01-02 18:30:14.658 WARN 3576 --- [ restartedMain] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "create table ecommerce.products (id bigint not null, active boolean not null, date_created timestamp, description varchar(255), image_url varchar(255), last_updated timestamp, name varchar(255) not null, price decimal(19,2), stock_keeping_unit varchar(255) not null, category_id bigint, primary key (id))" via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table ecommerce.products (id bigint not null, active boolean not null, date_created timestamp, description varchar(255), image_url varchar(255), last_updated timestamp, name varchar(255) not null, price decimal(19,2), stock_keeping_unit varchar(255) not null, category_id bigint, primary key (id))" via JDBC Statement
It seems that the schema
is the problem.
At the file Product.java
removing the schema = "ecommerce",
gives the following error
2023-01-02 18:33:57.667 INFO 20728 --- [ restartedMain] c.s.s.SpringDataJpaCourseApplication : Started SpringDataJpaCourseApplication in 2.933 seconds (JVM running for 3.358)
2023-01-02 18:33:57.674 INFO 20728 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-01-02 18:33:57.681 ERROR 20728 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Error thrown while acquiring connection from data source
org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:622) ~[h2-1.4.200.jar:1.4.200]
This is as far as I could go
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.