diff --git a/src/main/java/com/example/postgresdemo/PostgresDemoApplication.java b/src/main/java/com/example/postgresdemo/PostgresDemoApplication.java index 29cf2e1..34a87cc 100644 --- a/src/main/java/com/example/postgresdemo/PostgresDemoApplication.java +++ b/src/main/java/com/example/postgresdemo/PostgresDemoApplication.java @@ -1,5 +1,9 @@ package com.example.postgresdemo; + +import java.text.SimpleDateFormat; +import java.util.Date; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; @@ -8,6 +12,11 @@ @EnableJpaAuditing public class PostgresDemoApplication { public static void main(String[] args) { + Date date1 = new Date(); + SimpleDateFormat formatter =new SimpleDateFormat("yy-mm-dd HH:mm:ss"); + System.out.println("Start:" + formatter.format(date1)); SpringApplication.run(PostgresDemoApplication.class, args); + Date date2 = new Date(); + System.out.println("End:" + formatter.format(date2)); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 35b376a..d3e5805 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo +spring.datasource.url=jdbc:postgresql://localhost:5432/postgres spring.datasource.username= postgres -spring.datasource.password= +spring.datasource.password=root # The SQL dialect makes Hibernate generate better SQL for the chosen database spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect