cannot create jdbc driver of,jpa mysql 配置文件_Spring+JPA+MySQL的配置文件

 2023-10-21 阅读 30 评论 0

摘要:整合一下JPA +Springpersistence.xml默認放在?META-INF?目錄下Xml代碼 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence?persistence_1_0.xsd"version="1.0">org.hibernate.ejb.HibernatePersistenceMyClassxsi:schemaLocation&#

整合一下JPA +Spring

persistence.xml

默認放在?META-INF?目錄下

Xml代碼

0818b9ca8b590ca3270a3433284dd417.png

xsi:schemaLocation="http://java.sun.com/xml/ns/persistence?persistence_1_0.xsd"version="1.0">

org.hibernate.ejb.HibernatePersistence

MyClass

xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">

org.hibernate.ejb.HibernatePersistence

MyClass

applicationContext.xml

Xml代碼

0818b9ca8b590ca3270a3433284dd417.png

xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="http://www.springframework.org/schema/beans?http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

http://www.springframework.org/schema/aop?http://www.springframework.org/schema/aop/spring-aop-2.0.xsd

http://www.springframework.org/schema/tx?http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

com.mysql.jdbc.Driver

jdbc:mysql://localhost:3306

########

########

xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

com.mysql.jdbc.Driver

jdbc:mysql://localhost:3306

########

########

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/157862.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息