Guest User

Untitled

a guest
Sep 1st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. public void check() {
  2. try {
  3. InitialContext ic = new InitialContext();
  4. DataSource ds = (DataSource) ic.lookup("jdbc/sample");
  5. Connection conn = ds.getConnection();
  6. Statement stmt = conn.createStatement();
  7. ResultSet rs = stmt.executeQuery("SELECT * FROM peoples");
  8. while (rs.next()) {
  9. System.out.println(rs.getString("name"));
  10. }
  11.  
  12. } catch (NamingException | SQLException ex) {
  13. Logger.getLogger(TestConnection.class.getName()).log(Level.SEVERE, null, ex);
  14. }
  15. }
  16.  
  17. }
  18.  
  19. Info: RAR7114: Unable to get ClientInfo for connection
  20. Info: ??­?¤¦?? ?® § ???? ¬
  21. Info: ‚?¤???© ????? «??? ???­?????®?® ­ ¤§®?  ?® ?­????­­?¬ ?­¦?­??­?¬ ?????¬ ¬
  22. Info: ??­?¤¦??
  23. Info: ??­?¤¦?? ?® § ???? ¬
  24. Info: ‘???? «??? ?«?¦?? ???­?????®© ?®¤¤??¦??
  25. Info: “?? ?«????© ¬ ? §?­®¬
  26. Info: “?? ?«????© ¬ ? §?­®¬
  27. Info: ????®­ «?­?© ???­?? ?® ???­???
  28. Info: ??­?¤¦?? ?® ®?? ­?§ ??? ¬??®??????©
  29. Info: ‘???? «??? ?® ¬ ?????­??
  30. Info: visiting unvisited references
  31. Info: visiting unvisited references
  32. Info: visiting unvisited references
  33. Info: Loading application [SampleServer] at [/SampleServer]
  34. Info: ChessmanWorkServer was successfully deployed in 1 379 milliseconds.
  35.  
  36. Info: Loading application [SampleServer] at [/SampleServer]
  37. Info: ChessmanWorkServer was successfully deployed in 323 milliseconds.
  38. Info: RAR7114: Unable to get ClientInfo for connection
  39. Info: 82
  40. Info: 84
  41. Info: 78
  42. Info: 63
  43. Info: 62
  44. Info: 58
  45. Info: 56
  46. Info: 52
  47. Info: 48
  48. Info: 44
  49.  
  50. properties.setProperty("characterEncoding","cp1251");
  51. Connection con = DriverManager.getConnection("jdbc/sample",properties);
  52.  
  53. Properties properties=new Properties();
  54. properties.setProperty("user","логин");
  55. properties.setProperty("password","пароль");
  56. properties.setProperty("useUnicode","true");
  57. properties.setProperty("characterEncoding","cp1251");
  58. Connection connection=DriverManager.getConnection(
  59. "jdbc:mysql://localhost:3306/имяБазы", properties);
Add Comment
Please, Sign In to add comment