Database query

This feature helps administrators access database data easily and quickly without a third-party database client.

The results of the queries can be exported to SQL or CSV file formats.

Allowed types:

TypeDescriptionListExport

JDBC

SQL queries supported by the configured database.

When chosen, a list of available tables is shown.

Yes.

Hibernate

Neutral database queries based on Hibernate query format.

  No.
  • Writing more than one query is allowed.
  • Each query must be written on a single line; line breaks are not allowed.
  • Execute will process all written queries in the same order they were written, top to bottom. Queries are executed as FIFO (first in, first out).
  • If a query fails, it will not stop the execution of the others.

Execute JDBC query

  • On the bottom right choose type JDBC.
  • Write some valid SQL.
  • Click the Execute button.
  • Optionally, the results can be exported to SQL or CSV
    • Click on  Export to SQL icon.
    • Click on  Export to CSV icon.

Example:

// nodeBase = documents + folders + mails + records
SELECT count(*) from OKM_NODE_BASE;
SELECT count(*) from OKM_NODE_DOCUMENT;
SELECT count(*) from OKM_NODE_FOLDER;
SELECT count(*) from OKM_NODE_MAIL;
SELECT count(*) from OKM_NODE_RECORD;

// select first 10 records
SELECT * from OKM_NODE_BASE LIMIT 10;
SELECT * from OKM_NODE_DOCUMENT LIMIT 10;
SELECT * from OKM_NODE_DOCUMENT_VERSION LIMIT 10;
SELECT * from OKM_NODE_FOLDER LIMIT 10;
SELECT * from OKM_NODE_MAIL LIMIT 10;
SELECT * from OKM_NODE_RECORD LIMIT 10;

Execute Hibernate query

  • On the bottom right choose type Hibernate.
  • Write some valid HQL.
  • Optionally you can check the "Show SQL" option.
  • Click the Execute button.

When the "Show SQL" option is checked, the real SQL executed is shown in the results.

Example:

select count(*) from NodeBase;
select count(*) from NodeFolder;

Allowed sentences

  • On the bottom right choose a valid SQL file.
  • Click the Import SQL script button.