hibernate中文乱码(&和&)
来源:互联网 发布:java暑期培训班 编辑:程序博客网 时间:2024/06/06 18:14
1)数据库支持中文;
建表语句类似于下面的
DROP DATABASE IF EXISTS XDSCLIENT ;CREATE DATABASE XDSCLIENT CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';USE XDSCLIENT;DROP TABLE IF EXISTS client;create table client(id int primary key auto_increment,code varchar(200) not null unique,name varchar(200) not null unique,registryurl varchar(200) default null,registryurlssl varchar(200) default null,repositoryurl varchar(200) default null,repositoryurlssl varchar(200) default null,repositoryID varchar(200) default null unique) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- 插入基础数据insert into client (code,name,registryurl,registryurlssl,repositoryurl,repositoryurlssl,repositoryID)values('ClientA','厂商A','http://localhost:8010/axis2/services/xdsregistryb','https://localhost:8011/axis2/services/xdsregistryb','http://localhost:8020/axis2/services/xdsrepositoryb','https://localhost:8021/axis2/services/xdsrepositoryb','1.3.6.1.4.1.21367.13.2250.2000');insert into client (code,name,registryurl,registryurlssl,repositoryurl,repositoryurlssl,repositoryID)values('ClientB','厂商B','http://60.191.39.142:7096/registry/axis2/services/xdsregistryb','https://60.191.39.142:7096/registry_ssl/axis2/services/xdsregistryb','http://60.191.39.142:7096/repository/axis2/services/xdsrepositoryb','https://60.191.39.142:7096/repository_ssl/axis2/services/xdsrepositoryb','1.19.6.24.109.42.1.5');
2)数据库连接带上参数;
jdbc.url=jdbc:mysql://localhost:3306/xdsclient?useUnicode=true&characterEncoding=utf-8
注意点:
a)与符号(&和&)是否需要转意处理
b) characterEncoding=utf-8和characterEncoding=UTF-8等效,即(utf-8不区分大小写)
0 0
- hibernate中文乱码(&和&)
- JDBC和Hibernate中文乱码
- 使用Hibernate和Mysql中文乱码问题解决
- 使用Hibernate和mysql中文乱码问题
- hibernate提示表不存在和中文乱码
- Hibernate 中文乱码
- Hibernate中文乱码问题
- hibernate 中文乱码处理
- hibernate插入中文乱码
- hibernate mysql 中文乱码
- Hibernate插入中文乱码
- mysql中文乱码 hibernate
- Hibernate 中文乱码
- Hibernate - 中文乱码
- hibernate插入中文乱码
- Hibernate 存储 中文乱码
- JDBC和Hibernate连接MySQL中文乱码问题
- hibernate 的中文乱码解决办法
- FreeBSD root远程登录
- 奇怪的股市(Hell on the Markets,ACM/ICPC NEERC 2008, UVa1614)
- nginx的安装&配置静态文件访问
- Android开发中拷贝db文件写入SQLite
- Ubuntu Kylin 16.04安装配置FTP服务器
- hibernate中文乱码(&和&)
- Effective OC之对象、消息、运行时
- 安装Scrapy
- DefaultListableBeanFactory
- Android FFmpeg
- System.DllNotFoundException
- java对象与json对象间的相互转换
- 图像缩放算法
- 单源最短路径