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 the mysql.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';