Answer the question
In order to leave comments, you need to log in
How to write the config for Hibernate correctly?
I came across such a hefty error text, the essence of which, if I understood correctly, is that I incorrectly indicated the properties in xml
, yeah, and I wanted to ask how it is correct to register this config, for me it looks like this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/forFirstCRUD</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.connection.password">postgres</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</property>
<property name="hibernate.show_sql">true</property>
</session-factory>
</hibernate-configuration>
Answer the question
In order to leave comments, you need to log in
Java is such a special language for generating kilometer backtrace...
Why did you get null value in column violates not-null constraint and think that you have a problem with connecting to the DBMS? You are trying to insert NULL into a field marked NOT NULL. Judging by the text of the request, you did not specify the default value for this field.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question