配置c3p0-config.xml数据库连接池,jdbcurl配置项报错Type The reference to entity "useUnicode" must end with the ';' delimiter.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<c3p0-config>
<named-config name="mysql">
<property name="user">test01</property>
<property name="password">test01</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://10.49.40.127:3306/testdb?&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai</property>
<property name="initialPoolSize">10</property>
<!--最大空闲时间,30秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 -->
<property name="maxIdleTime">30</property>
<property name="maxPoolSize">100</property>
<property name="minPoolSize">10</property>
</named-config>
</c3p0-config>
上边这种配置方式 会报The reference to entity "useUnicode" must end with the ';' delimiter. 这个错误。
这是由xml文件中的编码规则决定要这么变换。在xml文件中有以下几类字符要进行转义替换:
| < | < | 小于号 |
| > | > | 大于号 |
| & | & | 和 |
| ' | ' | 单引号 |
| " | " | 双引号 |
正确的方式
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<c3p0-config>
<named-config name="mysql">
<property name="user">test01</property>
<property name="password">test01</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://10.49.40.127:3306/testdb?&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai</property>
<property name="initialPoolSize">10</property>
<!--最大空闲时间,30秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 -->
<property name="maxIdleTime">30</property>
<property name="maxPoolSize">100</property>
<property name="minPoolSize">10</property>
</named-config>
</c3p0-config>
配置c3p0-config.xml数据库连接池,jdbcurl配置项报错Type The reference to entity "useUnicode" must end with the ';' delimiter.的更多相关文章
- XML报错:The reference to entity "characterEncoding" must end with the ';' delimite
解决方法: 在web.xml增加如下配置: <filter> <filter-name>encodingFilter</filter-name> <fil ...
- 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';' delimiter.)
这次在配置xml文件时,出现错误提示( The reference to entity “useSSL” must end with the ‘;’ delimiter.) 报错行为 <prop ...
- 在配置XML时报的The reference to entity "dataSource" must end with the ';' delimiter错误
<?xml version="1.0" encoding="UTF-8"?> <ECharts> <element>http ...
- xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter
数据源配置时加上编码转换格式后出问题了: The reference to entity"characterEncoding" must end with the ';' deli ...
- 在java的xml文件配置数据库URL地址时提示The reference to entity "characterEncoding" must end with the ';' delimiter.错误信息
配置数据库的URL<property name="url" value="jdbc:mysql://127.0.0.1:3306/micro_message&quo ...
- 关于导入本地maven项目pom.xml出现missing artifact org....报错处理
一.导入本地maven项目步骤:
- webpack配置自动打包重新运行npm run dev出现报错
webpack配置自动打包重新运行npm run dev出现报错 运行npm run dev出现如下报错 Listening at http://localhost:8080(node:2328) U ...
- pom.xml里有红叉报错的解决办法
pom.xml里有红叉报错的解决办法一: 1.把鼠标点在报的错上发现pom.xml报如下错误: Multiple annotations found at this line: - Failure t ...
- 刚创建的maven项目,pom.xml的第一行就报错
刚创建的maven项目,马上pom.xml的第一行就报错这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xm ...
随机推荐
- bzoj 5019: [Snoi2017]遗失的答案【dp+FWT】
满足GL的组合一定包含GL每个质因数最大次幂个最小次幂,并且能做限制这些数不会超过600个 然后质因数最多8个,所以可以状压f[s1][s2]为选s1集合满足最大限制选s2集合满足最小限制 dfs一下 ...
- EOS:dfuse stream 保证不会错过一个心跳
强大的 dfuse history API 给我们带来了高效的链数据获取途径,让我们的 dapp 在用户体验上了一个台阶. 官方示例 不会错过一个心跳 代码分析 函数 pendingActions 待 ...
- noi.ac 邀请赛1 By cellur925
A. array 考场:上来就想暴力,首先第一个子任务肯定没问题,怎么搞都行.然后第二个子任务用个数组记下新修的值就行了.第三个子任务用一下等差数列求和公式帮助求解,每次都重新算(因为每次改变全部元素 ...
- Springboot配置类
配置类 MyAppConfig import com.test.springboot.service.HelloService; import org.springframework.context ...
- 51Nod 1021 石子归并(动态规划)
#include <iostream> #include <algorithm> #include <string> #include <iostream&g ...
- python之sys.argv[]
sys.argv[]说白了就是一个从程序外部获取参数的桥梁,这个“外部”很关键.因为我们从外部取得的参数可以是多个,所以获得的是一个列表(list),也就是说sys.argv其实可以看作是一个列表,所 ...
- KEIL软件仿真死在等待外部晶振起振
这是由于是Debug里面的设置有问题 主要是下面2项设置 Dialog DLL默认是DCM3.DLL Parameter默认是-pCM3 应改为 Dialog DLL默认是DARMSTM.DLL Pa ...
- idea使用Git提交代码时忽略指定文件或文件夹
简述 使用idea编写代码并使用git作为版本控制器的时候,常常不需要提交配置文件以及一些其他不需要提交的文件,可以使用.ignore插件来在上传的时候忽略一些文件或文件夹. 安装 注意:安装完成之后 ...
- 8 Explicit Animations 指明的动画 笔记
8 Explicit Animations 指明的动画 笔记 If you want something done right, do it yourself. 如果你想让事情做好,那就自动来 ...
- PHP Deprecated: Function split() is deprecated in /var/www/html/cacti/cmd.php on line 61
[root@localhost cacti]# php cmd.php PHP Deprecated: Function split() is deprecated in /var/www/html/ ...