Code snippet below shows how to specify the character set when connection to the database.

Java Code:
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);