Hi guys,
I am using the fullstack project template in the 2023.06-ext1 version, which has an H2 database in its standard configuration.
Id like to change the database to a postgres and found in the documentation that only a few properties have to be changed.
From the documentation page GetA12 Login I got following properties and configured them:
spring.datasource.dataservices.url=jdbc:postgresql://localhost:5432/testproject
spring.datasource.dataservices.driverClassName=org.postgresql.Driver
spring.datasource.dataservices.name=testproject
spring.datasource.dataservices.username=postgres
spring.datasource.dataservices.password=postgres
spring.jpa.database=POSTGRESQL
spring.datasource.hikari.connectionTimeout=30000
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
The problem is that the application is still starting with an H2 database. Besides that there are no errors logged.
2023-09-28T15:56:19.286+02:00 INFO 22768 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8082 (http)
2023-09-28T15:56:19.298+02:00 INFO 22768 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-09-28T15:56:19.299+02:00 INFO 22768 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.8]
2023-09-28T15:56:19.433+02:00 INFO 22768 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-09-28T15:56:19.434+02:00 INFO 22768 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4370 ms
2023-09-28T15:56:19.628+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023-09-28T15:56:19.927+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:faa87201-8b70-4c2c-8483-06c848434764 user=SA
2023-09-28T15:56:19.932+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2023-09-28T15:56:19.941+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
2023-09-28T15:56:19.946+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-2 - Added connection conn1: url=jdbc:h2:mem:contentstore user=SA
2023-09-28T15:56:19.947+02:00 INFO 22768 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
2023-09-28T15:56:19.947+02:00 INFO 22768 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/console/'. Databases available at 'jdbc:h2:mem:faa87201-8b70-4c2c-8483-06c848434764', 'jdbc:h2:mem:contentstore', 'jdbc:h2:mem:faa87201-8b70-4c2c-8483-06c848434764'
I also tried with the normal spring properties
spring.jpa.database=POSTGRESQL
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/testproject
spring.datasource.username=postgres
spring.datasource.password=postgres
And with a combination of both, but it’s still only using H2.
Maybe I am missing something?