jdbc连接Sqlite,MYsql 的编码修改
来源:互联网 发布:北京网络派出所 编辑:程序博客网 时间:2024/06/07 14:49
javaEE can use many heavy weight DBS such as Orach,DB2,sqlServer,Mysql.But Sqlite can also be with it. Some key settings are here:
1> Class.forName("org.sqlite.JDBC");
2> Connection cn = DriverManager.getConnection("jdbc:sqlite:filepath[where your .db stored");
Modify Mysql's character encoding:
This is what your command shows when you first input the command ( Mysql 5.5):
mysql> show variables like 'character%';
Then the results showing:
+--------------------------+---------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir |/usr/share/mysql/charsets/ |
+--------------------------+---------------------------------+
so if you want to raise the characterSet , you can modify it in themysql.in file(rather than view it as the commands) something like this:
1. First, modify the client settings:
default-character-set=utf8 // There must be utf8 rather than utf-8;
2. Second, modify the server:
character-set-server = utf8
So if you had done those above, all your character sets must be the utf8. But you will find the tribulance in the
command if you use the Chinese. This is because the XP cmd use the character "gbk" as default, hence it do show
messy code. But don't worry, run the command beneathe every time when you are using Chinese in the command,
it would be ok。
mysql> set character_set_results='gbk';
- jdbc连接Sqlite,MYsql 的编码修改
- JDBC连接MySQL的URL编码问题
- JDBC 连接mysql编码问题
- mysql的JDBC连接
- mysql的jdbc连接
- MySQL的JDBC连接
- 04-JDBC连接MySQL数据库【修改数据】
- MySQL的编码修改
- Java JDBC建立和Mysql、sql server 2005、sqlite和Oracle数据库的连接
- 2、Java应用中常见的JDBC连接字符串(SQLite、MySQL、Oracle、Sybase、SQLServer、DB2)
- 连接JDBC的URL格式为jdbc:sqlite:/path
- JDBC-简单的Mysql连接
- java连接mysql的JDBC
- jdbc连接mysql的方法
- JDBC 连接MySQL的使用。
- jdbc连接mysql的方法
- MySQL数据库的JDBC连接
- jdbc连接mysql的方法
- C# 绘制矢量图形
- 手机通讯录备份
- lnmp去掉nginx上传目录的PHP执行权限
- 测试程序中某个过程所用的时间(或算法效率),这样做可以吗?
- C# 中的XML操作详解:读取,过滤以及数据绑定
- jdbc连接Sqlite,MYsql 的编码修改
- smarty缓存1
- abstract class CBase{ public abstract void say_sth();
- 在没有jmf的电脑上安装使用jmf的程序
- smarty缓存2
- MySQL技巧:做好Limit优化
- reportviewer动态数据源
- Wince unicode 处理
- 虚拟机下通过NAT方式静态IP如何连外网