code: public static PrepareStatement prepare(Statement statement) {
          if (statement instanceof PrepareStatement) {
              return (PrepareStatement) statement;
          } else if (statement instanceof PreparedPayload) {
              PreparedPayload preparedPayload = (PreparedPayload) statement;
              return new PrepareStatement(preparedPayload.originalStatement(), preparedPayload.preparedName());
          } else {
              String preparedName = DigestUtils.digestSha1Hex(statement.toString());
              return new PrepareStatement(statement, preparedName);
          }
      }
docs: Construct a {@link PrepareStatement} from a select-like {@link Statement}.
  
  Note that passing a {@link PrepareStatement} will return it directly, whereas passing
  a {@link PreparedPayload} will reuse the {@link PreparedPayload#preparedName()}.
  
  @param statement the {@link Statement} to prepare.
  @return the prepared statement.
  @throws IllegalArgumentException when statement cannot be prepared.