How to insert Thai language in Oracle using Java bytes?
<pre><code>Connection con = null;
String url = "jdbc:oracle:thin:@//localhost:1521/xe";
String driver = "oracle.jdbc.OracleDriver";
String s = "สวัสดี";
System.out.println("Thai hello :" + s);
String temp = s.getBytes() + "";
String temp2 = new String(s.getBytes());
System.out.println("Thai temp bytes :" + temp);
System.out.println("Thai temp2 bytes :" + temp2);
try {
    Class.forName(driver);
    con = DriverManager.getConnection(url, "system", "xxxxx");

    try {
        PreparedStatement st = con.prepareStatement("INSERT into encodeleo VALUES(?)");
        st.setBytes(1, s.getBytes());
        st.executeUpdate();
        String temp1;
        ResultSet rs = st.executeQuery("select name from encodeleo");
        rs.next();
        temp1 = new String(rs.getBytes("name"));
        System.out.println("temp1 :" + temp1);
        System.out.println("1 row affected");
    } catch (SQLException se) {
        se.printStackTrace();
        System.out.println("SQL statement is not executed!");
    }
} catch (Exception e) {
    e.printStackTrace();
}
</code></pre>

<p>I tried using UTF-8, but I couldn't encode and decode other languages in Java.</p>

<p>Could please give me some idea also about how to use UTF-8 to encode the
string, insert into Oracle and get it back?</p>
