Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. CREATE TABLE Categories(code_interne_c varchar(100) primary key,
  2. description varchar(100));
  3.  
  4. INSERT INTO Categories VALUES ('01','Matières premières');
  5. INSERT INTO Categories VALUES ('02','Articles de conditionnement');
  6. INSERT INTO Categories VALUES ('03','Consommables production');
  7. INSERT INTO Categories VALUES ('04','Produits de nettoyage');
  8. INSERT INTO Categories VALUES ('05','Réactifs');
  9.  
  10. mysql> select * from categories;
  11. +----------------+-------------------------------------------+
  12. | code_interne_c | description |
  13. +----------------+-------------------------------------------+
  14. | 01 | Matières premières |
  15. | 02 | Articles de conditionnement |
  16. | 03 | Consommables production |
  17. | 04 | Produits de nettoyage |
  18. | 05 | Réactifs |
  19. +----------------+-------------------------------------------+
  20. 14 rows in set (0.00 sec)
  21.  
  22. public static String testreqchar(){
  23. try {
  24. Statement st = cx.createStatement();
  25. ResultSet rs = st.executeQuery("select * from categories");
  26. rs.next();
  27. return rs.getString(2)+"|| and test French accent characters : é ô ê à è û ";
  28. } catch (SQLException ex) {
  29. Logger.getLogger(Methodes.class.getName()).log(Level.SEVERE, null, ex);
  30. return null;
  31. }
  32. }
  33. public static void main(String a[]) {
  34.  
  35. System.out.println(testreqchar());
  36. }
  37.  
  38. MatiŠres premiŠres|| and test French accent characters : é ô ê à è û
  39.  
  40. Mysql 5.5.27 set on UTF-8 as charset on Win server 2008 R2 French
  41. mysql-connector-java-5.1.21
  42. JDK 1.7 Running on win 7 pro French.
  43.  
  44. Connection conn = DriverManager.getConnection
  45. ( "jdbc:mysql://localhost/bug_utf8?useUnicode=true&characterEncoding=UTF8"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement