• 要让mysql支持中文,有两种方法:
    1、用JDBC连的时候,URL要使用这样的形式:
    jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=EUC_CN
    这种方法性能可能有一定损失,因为要经过一定的转换。而且假如是在Tomcat里面用,又用了DBCP,则该方法无效。(我怀疑是由于DBCP的URL参数里面其他属性都是无效的,别的连接属性只能放在connectionProperties里面配置,但DBCP的文档对connectionProperties的配置说得不清不楚)。
    2、在my.ini的[mysqld]段下面加上default-character-set=gbk,则java端的URL无需加上useUnicode等参数,也可以正常处理中文。要注意的问题是这种方法如果用的是mysql-connector-java-3.0.11-stable-bin.jar驱动,则会出现下面的错误:
    Error: java.sql.SQLException: Error during query: Unexpected Exception: java.lang.StringIndexOutOfBoundsException message given: String index out of range: 40
    ……
    使用mysql-connector-java-3.1.2-alpha-bin.jar与mysql-connector-java-3.1.3-beta-bin.jar都可以正常工作。

  • 2004年08月26日

    在Apache2中安装php5

    Tag:develop
    1、将php安装目录加到path环境变量中;
    2、将php.ini-recommended改名为php.ini
    3、Installing as an Apache module
       在Apache的httpd.conf配置文件中插入下面两行(将c:/php替换为你的php的安装目录)
    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
     
    # configure the path to php.ini
    PHPIniDir "C:/php"
    4、测试安装成功后,修改extension_dir (在php.ini中),并打开要使用的extension
  • 2004年08月14日

    the matrix of Design Patterns

    Tag:develop

    You can download it at http://www.blogbus.com/blogbus/blog/userfiles/18362/1092446039.rar

    It is made by Ram.

    Fabulous!Enjoy it!

  • JaWE depends on JGraph Swing Component (www.jgraph.com), and it generally steers look 'n' feel of JaWE.

    Property dialogs follow XPDL specification. They're implemented in org.enhydra.jawe.xml package.

    I use GNU/Emacs and eclipse.

    regards
    --
    Vladimir Puskas
    Together, Serbia

  • 一是界面的乱码,在File->Global Preferences->Fonts选项卡里面,选择相应的中文字体(我选新宋体,12)就可以了。

    二是显示数据库里面的内容乱码。以MySQL为例,只需要在设置Alias的时候,这样设置URL:jdbc:mysql://server1/test?useUnicode=true&characterEncoding=EUC_CN