Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onLogin(connect) {
- try {
- conn = etc.getSQLConnection();
- player = new ArrayList<online>();
- ps = conn.prepareStatement("SELECT * FROM users");
- rs = ps.executeQuery();
- while (rs.next()) {
- Group group = new Group();
- player.yes = rs.getBoolean("1");
- player.no = rs.getBoolean("0");
- player.ID = rs.getInt("id");
- if (player.yes.length == 0)
- {
- //Updates the database field online in the users table mysql to 1
- }
- } catch (SQLException ex) {
- log.log(Level.SEVERE, "User Online count not working hmm :(", ex);
- }
- }
- public boolean onDisconnect(connect) {
- try {
- conn = etc.getSQLConnection();
- player = new ArrayList<online>();
- ps = conn.prepareStatement("SELECT * FROM users");
- rs = ps.executeQuery();
- while (rs.next()) {
- Group group = new Group();
- player.yes = rs.getBoolean("1");
- player.no = rs.getBoolean("0");
- player.ID = rs.getInt("id");
- if (player.yes.length == 1)
- {
- //Updates the database field online in the users table mysql to 0
- }
- } catch (SQLException ex) {
- log.log(Level.SEVERE, "User Online count not working hmm :(", ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement