public int countAll(){
    	 Connection con = null;
         Statement stmt = null;
       
         try {
             DBconnection dbCon = new DBconnection();
             Class.forName(dbCon.getJDBC_DRIVER());

             con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
                     dbCon.getDB_USERNAME(), dbCon.getDB_PASSWORD());
             stmt=con.createStatement();

             ResultSet rs=stmt.executeQuery("Select Count(*) as countall from author");
             
             if(rs.next())
             {
            	 int count=rs.getInt("countall");
            	 return count;
            	 }
         } catch (SQLException | ClassNotFoundException ex) {
             System.err.println("Caught Exception: " + ex.getMessage());
         } finally {
             try {
                 if (stmt != null) {
                     stmt.close();
                 }
                 if (con != null) {
                     con.close();
                 }
             } catch (SQLException ex) {
                 System.err.println("Caught Exception: " + ex.getMessage());
             }
         }
         
         return 0;
    	
    }