Jump to Real's How-to Main page

Specify a CharSet when connecting to a DBMS

Class.forName(sun.jdbc.odbc.JdbcOdbcDriver) ;
 
// setup the properties 
java.util.Properties prop = new java.util.Properties();
prop.put("charSet", "iso-8859-7");  // for example...
prop.put("user", username);
prop.put("password", password);

// Connect to the database
con = DriverManager.getConnection(url, prop);

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]