Use Java to connect to the remote Sybase Database. The test statement is
Class. forName ("com. sybase. jdbc3.jdbc. SybDriver"). newInstance ();
String url = "jdbc: sybase: Tds: IP Address: Connection port number/database"; // database indicates the name of the database to be connected.
Connection conn = DriverManager. getConnection (url, user, password );
The connection is successfully tested;
Due to the differences between the data character sets of local machines and remote machines, Chinese Character garbled characters may occur when writing data to remote databases. According to the previous experience of Informix, Chinese character encoding of Chinese fields is converted in the program, I found that the problem was not solved, but it was indeed caused by the character encoding problem. After consulting with my former colleagues, I finally solved the problem, and it was relatively simple. ^_^
Change the second line of the above Code:
String url = "jdbc: sybase: Tds: IP Address: Connection port number/database? CHARSET = cp936 "; // The name of the database to be connected.