zoukankan      html  css  js  c++  java
  • jpa报错 Unable to acquire a connection from driver [null], user [null] and URL [null]

    jpa报错 Unable to acquire a connection from driver [null], user [null] and URL [null]

    为啥报错

    因为你在persistence.xml中没配置你数据库的相应信息

    咋解决

    persistence.xml在哪里?

    咋编辑这东西?

    咋配置

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.1"
    	xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
    	<persistence-unit name="Project1_Group5_ClientTierApp"
    		transaction-type="RESOURCE_LOCAL">
    		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    
    
    		<class>org.client.jpa.User</class>
    
    		<properties>
    
    			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/webdevelopmentpracticuum_database?characterEncoding=UTF-8" />
    			<property name="javax.persistence.jdbc.user" value="你账号一般是root看你改没改过" />
    			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
    			<property name="javax.persistence.jdbc.password" value="你密码,我不能告诉你我自己的 />
    			<property name="eclipelink.ddl-generation" value="create-tables" />
    			<property name="eclipelink.jdbc.connections.min" value="1" />
    			<property name="eclipelink.jdbc.connections.max" value="2" />
    			<property name="eclipelink.logging.level" value="FINEST" />
    
    		</properties>
    	</persistence-unit>
    
    </persistence>
    
    
  • 相关阅读:
    vue后台管理系统——权限管理模块
    vue后台管理系统——用户管理模块
    vue后台管理系统——主页布局
    vue后台管理系统——登录/退出功能
    vue后台管理系统
    kratos 日志请求响应记录
    composer 版本切换
    Nacos搭建并使用
    go micro 搭建微服务
    consul命令行参数
  • 原文地址:https://www.cnblogs.com/mengxiaoleng/p/11878326.html
Copyright © 2011-2022 走看看