users@glassfish.java.net

How to set charset for sybase datasource?

From: <glassfish_at_javadesktop.org>
Date: Sun, 04 Jan 2009 18:23:13 PST

Code below works well:

  SybDriver sybDriver = (SybDriver) Class.forName(
                            "com.sybase.jdbc2.jdbc.SybDriver").newInstance();
  Properties props = new Properties();
  props.put("user", _user);
  props.put("password", _password);
  [b]props.put("charset", "cp936");[/b]
  _con = sybDriver.connect(_server, props);

Then I try to configure a datasource. I put "charset cp936" into Additional Properties.
It can get data from database. But character encoding is wrong. I also try to set the url as below:

  jdbc:sybase:Tds:192.168.1.12:5000/como?charset=cp936

The result is same. I think the problem is about how to set properties for jdbc driver.

I need you help. Thanks.
[Message sent by forum member 'daiwang' (daiwang)]

http://forums.java.net/jive/thread.jspa?messageID=324012