Update Feladat_DB.md
This commit is contained in:
28
Feladat_DB.md
Normal file
28
Feladat_DB.md
Normal file
@@ -0,0 +1,28 @@
|
||||
Vagy indits egy postgres db-t vagy csatlakozhatsz az enyemre
|
||||
jdbc:postgresql://db.zv.25u.com:5432/java
|
||||
|
||||
url db.zv.25u.com
|
||||
port 5432
|
||||
db name java
|
||||
username istvan
|
||||
password `.b0wU?#DXKRqfkgF,oB}da:naL4e^XjbL~}@!aNK,+n>CpKYPoDZ:%BH^W!W4U%^nrso-qMjbUw)5HVCD#2Dh=8%5]~fLsRsXW?*`
|
||||
|
||||
|
||||
https://www.geeksforgeeks.org/springboot/spring-boot-integration-with-postgresql-as-a-maven-project/#:~:text=This%20is%20the%20maven%20project.%20All%20dependencies%20need%20to%20be%20specified%20under%20pom.xml.%20As%20we%20are%20connecting%20PostgreSQL%2C%20this%20dependency%20is%20significant
|
||||
|
||||
A kijelolt szekciotol kezdve nezd a guideot.
|
||||
|
||||
Kulso dependencykent bekell huzni a postgresql csatlakozasra a connectort a `pom.xml`-be
|
||||
|
||||
`src/main/resources/application.properties` fileba fel kell venni az adatbazis elerhetosegeit
|
||||
```
|
||||
spring.datasource.url = jdbc:postgresql://host:port/dbname
|
||||
spring.datasource.username = postgres
|
||||
spring.datasource.password = password
|
||||
spring.jpa.hibernate.ddl-auto = update
|
||||
```
|
||||
|
||||
A User.class-bol csinaljal egy entity-t, es egeszids ki id-vel.
|
||||
|
||||
Hozz letre egy UserRepository-t, es a UserController-t alakitsd at ugy hogy a createNewUser az adatbazisba mentsen le egy User-t, a getUsers pedig olvassa ki az osszes lementett User-t az adatbazisbol.
|
||||
|
||||
Reference in New Issue
Block a user