Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void check() {
- try {
- InitialContext ic = new InitialContext();
- DataSource ds = (DataSource) ic.lookup("jdbc/sample");
- Connection conn = ds.getConnection();
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT * FROM peoples");
- while (rs.next()) {
- System.out.println(rs.getString("name"));
- }
- } catch (NamingException | SQLException ex) {
- Logger.getLogger(TestConnection.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- Info: RAR7114: Unable to get ClientInfo for connection
- Info: ???¤¦?? ?® § ???? ¬
- Info: ‚?¤???© ????? «??? ????????®?® ¤§®? ?® ??????¬ ?¦????¬ ?????¬ ¬
- Info: ???¤¦??
- Info: ???¤¦?? ?® § ???? ¬
- Info: ‘???? «??? ?«?¦?? ????????®© ?®¤¤??¦??
- Info: “?? ?«????© ¬ ? §?®¬
- Info: “?? ?«????© ¬ ? §?®¬
- Info: ????® «??© ????? ?® ??????
- Info: ???¤¦?? ?® ®?? ?§ ??? ¬??®??????©
- Info: ‘???? «??? ?® ¬ ???????
- Info: visiting unvisited references
- Info: visiting unvisited references
- Info: visiting unvisited references
- Info: Loading application [SampleServer] at [/SampleServer]
- Info: ChessmanWorkServer was successfully deployed in 1 379 milliseconds.
- Info: Loading application [SampleServer] at [/SampleServer]
- Info: ChessmanWorkServer was successfully deployed in 323 milliseconds.
- Info: RAR7114: Unable to get ClientInfo for connection
- Info: 82
- Info: 84
- Info: 78
- Info: 63
- Info: 62
- Info: 58
- Info: 56
- Info: 52
- Info: 48
- Info: 44
- properties.setProperty("characterEncoding","cp1251");
- Connection con = DriverManager.getConnection("jdbc/sample",properties);
- Properties properties=new Properties();
- properties.setProperty("user","логин");
- properties.setProperty("password","пароль");
- properties.setProperty("useUnicode","true");
- properties.setProperty("characterEncoding","cp1251");
- Connection connection=DriverManager.getConnection(
- "jdbc:mysql://localhost:3306/имяБазы", properties);
Add Comment
Please, Sign In to add comment