I load 3 strings from a CMS.
String Data da Noticia
String Titulo da Noticia
String Texto da Noticia
Within a loop , I create the query to insert with these 3 strings.
I'm just having some problems.
1st) The string Text of the News, has characters like "-" and "'" to solve, I used replace
. But would you have some way to insert, without having to remove those characters from the text of the news?
2º) Characters with accentuation of the text of the news such as "ç", "é", "á" are being saved in the bank as a "?"
I tried to use this:
pstmt = con.prepareStatement("SET NAMES 'utf8'");
pstmt.executeUpdate();
pstmt = con.prepareStatement("SET CHARACTER SET utf8");
pstmt.executeUpdate();
But it does not solve. In the bank I also set to utf8 and unicod.
Does anyone know how to solve these 2 problems?