docs: protected PreparedStatement prepareStatement(Connection con,
                                                   String sql,
                                                   boolean scrollable,
                                                   boolean createPreparedStatement,
                                                   int explicitFetchSizeHint)
          throws SQLException
      {
          PreparedStatement result;
  
          // if a JDBC1.0 driver is used the signature
          // prepareStatement(String, int, int) is  not defined.
          // we then call the JDBC1.0 variant prepareStatement(String)
          try
          {
              // if necessary use JDB1.0 methods
              if (!FORCEJDBC1_0)
              {
                  if (createPreparedStatement)
                  {
                      result =
                          con.prepareStatement(
                              sql,
                              scrollable
                                  ? ResultSet.TYPE_SCROLL_INSENSITIVE
                                  : ResultSet.TYPE_FORWARD_ONLY,
                              ResultSet.CONCUR_READ_ONLY);
                      afterJdbc2CapableStatementCreate(result, explicitFetchSizeHint);
                  }
                  else
                  {
                      result =
                          con.prepareCall(
                              sql,
                              scrollable
                                  ? ResultSet.TYPE_SCROLL_INSENSITIVE
                                  : ResultSet.TYPE_FORWARD_ONLY,
                              ResultSet.CONCUR_READ_ONLY);
                  }
              }
              else
              {
                  if (createPreparedStatement)
                  {
                      result = con.prepareStatement(sql);
                  }
                  else
                  {
                      result = con.prepareCall(sql);
                  }
              }
          }
          catch (AbstractMethodError err)
          {
              // this exception is raised if Driver is not JDBC 2.0 compliant
              log.warn("Used driver seems not JDBC 2.0 compatible, use the JDBC 1.0 mode", err);
              if (createPreparedStatement)
              {
                  result = con.prepareStatement(sql);
              }
              else
              {
                  result = con.prepareCall(sql);
              }
              FORCEJDBC1_0 = true;
          }
          catch (SQLException eSql)
          {
              // there are JDBC Driver that nominally implement JDBC 2.0, but
              // throw DriverNotCapableExceptions. If we catch one of these
              // we force usage of JDBC 1.0
              if (eSql
                  .getClass()
                  .getName()
                  .equals("interbase.interclient.DriverNotCapableException"))
              {
                  log.warn("JDBC 2.0 problems with this interbase driver, we use the JDBC 1.0 mode");
                  if (createPreparedStatement)
                  {
                      result = con.prepareStatement(sql);
                  }
                  else
                  {
                      result = con.prepareCall(sql);
                  }
                  FORCEJDBC1_0 = true;
              }
              else
              {
                  throw eSql;
              }
          }
          try
          {
              if (!ProxyHelper.isNormalOjbProxy(result))  // tomdz: What about VirtualProxy
              {
                  platform.afterStatementCreate(result);
              }
          }
          catch (PlatformException e)
          {
              log.error("Platform dependend failure", e);
          }
          return result;
      }