简体   繁体   中英

How to create Springboot App with postgres using spring native graalvm?

I was trying to create a CRUD app using spring boot and postgres,alongwith spring native.But I couldn't find any proper documentation related to it apart from spring native documentation .

The part of how to integrate it with postgres,is what I am looking for.Thankyou

You can use Spring Data like you would in a standard Spring Boot application. Depending on the type of application, you can use Spring Data JDBC, Spring Data JPA (if you need the Hibernate features), or Spring Data R2DBC (for reactive apps). If you bootstrap your application from start.spring.io , you can directly select the PostgreSQL dependency from there.

To get started with Spring Data, you can refer to this guide on the Spring website: relational data access with Spring Data JDBC . It uses H2, but you can replace it with PostgreSQL. More details are available on the project documentation .

On my GitHub, you can find an example of Spring Boot application with a REST API, security, and data persistence with PostgreSQL. And packaged as a native executable through Spring Native. If you're new to Spring Native, I wrote an article about how to get started with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM