code: private void createPreparedStatement(final String name, final String query, final int timeout, final boolean recovering) throws NameAlreadyExistsException, DatabaseEngineException {
  
          if (!recovering) {
              if (stmts.containsKey(name)) {
                  throw new NameAlreadyExistsException(String.format("There's already a PreparedStatement with the name '%s'", name));
              }
              try {
                  getConnection();
              } catch (final Exception e) {
                  throw new DatabaseEngineException("Could not create prepared statement", e);
              }
          }
  
          PreparedStatement ps;
          try {
              ps = conn.prepareStatement(query);
              if (timeout > 0) {
                  ps.setQueryTimeout(timeout);
              }
              stmts.put(name, new PreparedStatementCapsule(query, ps, timeout));
          } catch (final SQLException e) {
              throw new DatabaseEngineException("Could not create prepared statement", e);
          }
      }
docs: Creates a prepared statement.
  
  @param name       The name of the prepared statement.
  @param query      The query.
  @param timeout    The timeout (in seconds) if applicable. Only applicable if > 0.
  @param recovering True if calling from recovering, false otherwise.
  @throws NameAlreadyExistsException If the name already exists.
  @throws DatabaseEngineException    If something goes wrong creating the statement.