Database query
The Database Query feature helps administrators access database data directly from the application without requiring a third-party database client. Query results can be exported to SQL or CSV format.
Allowed types:
| Type | Description | List | Export |
|---|---|---|---|
| JDBC | SQL queries supported by the configured database. | When chosen, a list of available tables is shown. | Yes. |
| Hibernate | Database-neutral queries based on Hibernate Query Language (HQL). | No. |
Execute JDBC query
Section titled “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.
- Click on
Example:
-- nodeBase = documents + folders + mails + recordsSELECT 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 recordsSELECT * 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
Section titled “Execute Hibernate query”- On the bottom right choose type Hibernate.
- Write some valid HQL.
- Optionally, check the Show SQL option to display the actual SQL being executed.
- Click the Execute button.
Example:
select count(*) from NodeBase;select count(*) from NodeFolder;Import SQL Script
Section titled “Import SQL Script”- On the bottom right, choose a valid SQL file.
- Click the Import SQL script button.