Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int sizeOfLoginColumn() throws SQLException {
- int size = 0;
- try {
- connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/usersdb?"
- + "user=root&password=");
- String sql = "select count(*) from users";
- Statement ps = connection.createStatement();
- rsContact = ps.executeQuery(sql);
- size = rsContact.getInt(1);
- System.out.println(size);
- } catch (SQLException ex) {
- Logger.getLogger(DataBaseConnection.class.getName()).log(Level.SEVERE, null, ex);
- }
- return size;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement