Faced a problem on data output from MySQL. Most likely the problem is in the encoding. I did something similar before, but already forgot. Can you remind what you need to do here?
Here is the class:
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); } } } Here is the output log in the glaze:
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. Here is the output log if instead of name specify rating (user rating, column in the table).
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 I sit here, sadly watching these kozyabry. Gentlemen, options?
A day later: Made a servlet here is a screen. The problem is not in the coding netbinsa. 
Here is the script for creating the table (peoples replaced with workers, the table created more accurately nothing happened) 