Created attachment 37885 [details] Unit test cases for the Statement Facade class tomcat-jdbc versions: 10.0.6 and 9.0.26 Statement objects created by the StatementFacade will throw exceptions from the equals method, if the provided comparison object is not a "java.lang.refelect.Proxy". According to the javadoc for object this method should never throw and exception, but rather it should return false in those cases. This becomes an issue when prepared statements are stored and retrieved from HashMaps and HashSets. A proposed fix is to update the embedded StatementProxy.invoke() method with the following: if (compare(EQUALS_VAL, method)) { try { Object rhs = args[0]; if (rhs instanceof Proxy) { rhs = Proxy.getInvocationHandler(rhs); } return Boolean.valueOf(this.equals(rhs)); } catch (Exception e) { return Boolean.FALSE; } } Also attached is a unit test.