hibernate连接到postgresql的配置是什么?
import org.hibernate.cfg.Configuration;
public class StudentHibernate {
public static void main(String[] args) {
Configuration config = new Configuration();
config .setProperty("hibernate.dialect","org.hibernate.dialect.PostgreSQL");
config.setProperty("hibernate.connection.driver_class","");
}
}
答案 0 :(得分:1)
试试这个:
config .setProperty("hibernate.dialect","org.hibernate.dialect.PostgreSQLDialect");
config.setProperty("hibernate.connection.driver_class"," org.postgresql.Driver");
此致
答案 1 :(得分:0)
我通常使用这个:
hibernate.connection.username=user
hibernate.connection.password=password
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.url=url
hibernate.connection.driver_class=org.postgresql.Driver