Skip to main content
This tutorial runs real queries against Rfam, the public MySQL database of RNA families operated by EMBL-EBI, with Ensembl’s public server as a second example. Both are officially public with published credentials, so you can reproduce every call here exactly — RWS QA runs these very queries against the deployed service.

Prerequisites

  • The RWS Connect Live JDBC connection from the Live JDBC reference, with your x-api-key
  • x_db_password always names a stored credential — for a passwordless public user, RWS stores an empty credential once (e.g. PUBLIC_NO_PASSWORD); email connect@rwsintegration.com

Step 1: A first unpaged query

Count Rfam’s RNA families:
The count is a string — like every value in the response contract.

Step 2: Paginate with a cursor

The family table’s 4,227 rows fit under the 5,000-row unpaged cap, but it makes a perfect paging exercise with verifiable totals. rfam_acc is the primary key — the unique key paging needs: The first call carries no x_cursor; each response’s next_cursor feeds the next call, until it comes back null. In the RWS Application, the cursor pagination config from the Live JDBC reference drives the loop for you. Verified result on the live service: 4,227 rows in 5 pages of up to 1,000 — 4,227 distinct accessions, no duplicates, no gaps (offset mode returns the identical set). The updated column is a MySQL TIMESTAMP and arrives as an ISO string.
A trailing -- comment at the end of x_sql is safe: the pagination wrapper puts its closing parenthesis on a new line, so the comment can’t swallow it. Verified with this exact query.

The Ensembl variant

Ensembl’s public server answers the same way — only the URL and user change: Note the URL names no database — pick one per query with fully qualified table names, or put the schema in the URL. DECIMAL and DATE columns were verified to arrive as exact strings.

MySQL notes

  • MySQL as old as 5.6 works — both public servers run it.
  • Paginated queries run as a derived table with LIMIT ... OFFSET or a keyset WHERE — any valid SELECT without its own ORDER BY works.
  • A non-default port travels in the URL (:4497 above), nothing else changes.

Next steps

Live JDBC guide

The full reference: directives, pagination, errors

MariaDB tutorial

The same flow against the UCSC Genome Browser — and the one TLS gotcha