0
Personal opa I’m making a very simple application, to see how postgresql works. I’m making a Spring Api application.
My class
@Entity
public class Product Implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nome;
private BigDecimal valor;
private int quantidade;
remainder of the code
My build.Radle:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
Application properties
spring.datasource.url = jdbc:postgresql://localhost:5432/product
spring.datasource.username = postgres
spring.datasource.password = 123
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL94Dialect
spring.jpa.show-sql = false
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.format_sql=true
Following errors:
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Man, almost 100% sure that Radle downloaded the corrupt drivers, I can’t tell for sure if the import is correct as I use Maven. But try to clean, delete the package, and download again. And give a check on the properties of postgres, if there is nothing wrong with the connection parameters that you configuring in the properties of the application.
– Rodrigo Nantes
@Rodrigonantes in reality the application is getting to the bank, just missing the scheme to be created
– nullptr