当前位置: 代码迷 >> 综合 >> hibernate程序的异常:java.lang.UnsupportedOperationException: The user must supply a JDBC connection
  详细解决方案

hibernate程序的异常:java.lang.UnsupportedOperationException: The user must supply a JDBC connection

热度:56   发布时间:2023-11-27 14:51:31.0
hibernate程序的异常:java.lang.UnsupportedOperationException: The user must supply a JDBC connection

在使用JPA时请注意,Hibernate 3.x和4.x具有不同的语法,如下所述(在将Hibernate 4.x降级到3.x时将其命中)。

https://stackoverflow.com/questions/9906274/java-lang-unsupportedoperationexception-the-user-must-supply-a-jdbc-connection

更改如下(Hibernate 4.x语法):

<properties><property name="javax.persistence.jdbc.driver" value="..."/><property name="javax.persistence.jdbc.url" value="..."/><property name="javax.persistence.jdbc.user" value="..."/><property name="javax.persistence.jdbc.password" value="..."/></properties>

使用(Hibernate 3.x语法):

<properties><property name="hibernate.connection.driver_class" value="..."/><property name="hibernate.connection.url" value="..."/><property name="hibernate.connection.username" value="..."/><property name="hibernate.connection.password" value="..."/></properties>
  相关解决方案