title: Checking if table exists on MySQL RDMS
body: <p>I have here java code accessing mySQL database. It checks if table exists. The table is removed and does not exist, though code below is saying that the table exists.</p>
  
  <pre><code>private Boolean tableExists(String globalId) {
    // schema Test
    DBResult result =  db.selectQuery("SELECT table_name 
                                         FROM information_schema.tables 
                                        WHERE table_schema = '"+schema+"' 
                                          AND table_name = " + "\'" + "category_"+globalId.split("-")[1]+ "\'"+";");
    if(result.getRowCount() &gt; 0) {
      logger.info(" Table exist "+globalId);
      return true; 
    } else {
      logger.info("table does not exist "+ globalId);
      return false;
    }
  }
  </code></pre>
  
  <p>The method returns true that table exists. Later on, the program catches that the table does not exists and crashes. What is the problem, please? The program runs on Tomcat 6.</p>