【问题标题】:PostgreSQL driver "Unable to load class "PostgreSQL 驱动程序“无法加载类”
【发布时间】:2015-01-27 00:32:20
【问题描述】:

我想将我的应用程序与数据库连接起来。我正在使用日食。将 JDBC 驱动程序添加到类路径中,编译后出现消息错误:

Could not load requested class : com.postgresql.Driver

我的 hibernate.cfg.xml 看起来像:

    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="connection.driver_class">com.postgresql.Driver</property>

    <property name="connection.url">jdbc:postgresql://localhost:5432/postgres</property>

你有什么想法吗?

【问题讨论】:

    标签: java eclipse hibernate postgresql jdbc


    【解决方案1】:

    类名是org.postgresql.Driver(不是com.

    详情见手册:http://jdbc.postgresql.org/documentation/93/load.html

    【讨论】:

      猜你喜欢
      • 2018-08-05
      • 2012-06-20
      • 2020-10-27
      • 2021-11-09
      • 2022-01-26
      • 2017-05-17
      • 2020-03-18
      相关资源
      最近更新 更多