Share this page 

Specify a CharSet when connecting to a DBMSTag(s): JDBC


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);