@Override
    public boolean equals(Object object) {
        if (object == null) {
            return false;
        }
        if (!(object instanceof CachedPreparedStatement)) {
            return false;
        }
        if (this == object) {
            return true;
        }
        CachedPreparedStatement otherStmt = (CachedPreparedStatement)object;
        return (sql == null && otherStmt.sql == null) || sql != null && sql.equals(otherStmt.sql)
                && types.equals(otherStmt.types) && params.equals(otherStmt.params);
    }
Sets all parameters on the given PreparedStatement. The standard code block
for turning a CachedPreparedStatement into a PreparedStatement is as follows:

<pre>
PreparedStatement pstmt = con.prepareStatement(cachedPstmt.getSQL());
cachedPstmt.setParams(pstmt);
</pre>

@param pstmt the prepared statement.
@throws java.sql.SQLException if an SQL Exception occurs.
xmppserver/src/main/java/org/jivesoftware/database/CachedPreparedStatement.java