title: Method com/mysql/jdbc/PreparedStatement.isClosed()Z is abstract
body: <p>I'm trying to change the connection pool of my app, in order to use Tomcat's connection pool (org.apache.tomcat.jdbc.pool) instead of "Apache Commons DBCP".</p>
  
  <p>However, I'm getting this error when trying to connect to the DB:</p>
  
  <pre><code>javax.servlet.ServletException: java.lang.AbstractMethodError: Method com/mysql/jdbc/PreparedStatement.isClosed()Z is abstract
  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909)
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838)
  ...
  ...
  </code></pre>
  
  <p>I've read in other links that normally this is a problem with the MySQL-JDBC driver version, however, I've just updated to the latest Connector/J version (mysql-connector-java-8.0.11.jar) but I'm still getting this error.</p>
  
  <p>Here's how the connection pool is created:</p>
  
  <p>First, this goes on the context.xml file in the META-INF directory of my app:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;Context&gt;
  &lt;Resource
      name="rhwebDB"
      auth="Container"
      type="javax.sql.DataSource"
      factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
      testWhileIdle="true"
      testOnBorrow="true"
      testOnReturn="false"
      validationQuery="SELECT 1"
      validationInterval="30000"
      timeBetweenEvictionRunsMillis="30000"
      maxActive="10"
      minIdle="5"
      maxIdle="10"
      maxWait="10000"
      initialSize="2"
      removeAbandonedTimeout="60"
      removeAbandoned="true"
      logAbandoned="true"
      minEvictableIdleTimeMillis="30000"              
      username="dbUser"
      password="dbPwd"
      driverClassName="com.mysql.jdbc.Driver"
      url="jdbc:mysql://127.0.0.1:3306/rhweb2015"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Then I have a DBUtil.class that all the other libraries use:</p>
  
  <pre><code>public class DBUtil {
  
      static Connection connection = null;
      static {
          try {
              Context context = new InitialContext();
              DataSource ds = (DataSource)context.lookup("java:comp/env/rhwebDB");
              connection = ds.getConnection();
          } catch (NamingException e) {
              System.out.println("DBUtil.NamingException" + e);
          } catch (SQLException e) {
              System.out.println("DBUtil.SQLException" + e);
          }
      }
  
      public static Connection getConnection() {
          return connection;
      }
  
      public static synchronized void closeConnection(Connection conn) {
          try {
              if (conn != null &amp;&amp; !conn.isClosed())
                  conn.close();
          } catch (SQLException sqle) {
              System.out.println("Error closing the connection ! " + sqle);
          }
  
      }
  }
  </code></pre>
  
  <p>And finally, all the other java libraries use the connection pool like this:</p>
  
  <pre><code>public boolean someFunction( String myValue ){
      Connection conn = null;
      boolean fRetVal = false;
  
      String query = "select something from anytable";
  
      try {
          conn = DBUtil.getConnection();
          Statement stmt = conn.createStatement();
          ResultSet rs = stmt.executeQuery( query );
  
          if ( rs.next() )
              fRetVal = true;
  
          rs.close();
          stmt.close();
  
      } catch( SQLException ex ) {
              System.out.println(ex);
      }finally{
          DBUtil.closeConnection(conn);
      }
  
      return fRetVal;
  }
  </code></pre>
  
  <p>Am I missing something? I don't get any errors when Tomcat starts.</p>
  
  <p>JDK version: 8 (java version "1.8.0_111")
  Tomcat version: 8.5.8
  MySQL Server 5.6</p>
  
  <p>Any help will be really appreciated</p>