i was saving chinese in mysql on windows
the column is text and mapping to java.sql.Clob
when i used the orgin code from hibernate , i couldn't save chinese well
i think this is because of the code use: AsciiStream
so i change the code to:
Code:
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
String str = (String) value;
st.setCharacterStream( index, new StringReader(str), (int) str.length() );
}
then , everything is ok
anyone else has the same experience?