IntelliJ IDEA’s Built‑In Database Console: Query, Edit, and Page Like a Pro
IntelliJ IDEA’s Database Tools let you run SQL, page large result sets, and edit rows inline—all inside the IDE. Follow this guide to set up a JDBC connection, use pagination, and commit edits safely.
29 Jan 2026, 10:03 UTC

Why you should use IntelliJ’s Database Tools
When working on a project that touches a database, the quickest way to test a query or tweak a row is often to drop out of the IDE, open a terminal client, and type the commands yourself. IntelliJ IDEA bundles a full‑featured database console that lets you write SQL, run it, edit rows inline, and page results—all inside the same window. This reduces context switching, keeps your credentials encrypted in the IDE’s settings store, and gives you visual schema exploration without leaving the editor.
Step 1 – Create a JDBC Connection
Open the Database tool window: View → Tool Windows → Database. Click the + icon and choose Data Source → JDBC. Fill in the connection details:
Driver: MySQL (or PostgreSQL, Oracle, etc.)
Host: <YOUR_DB_HOST>
Port: <YOUR_DB_PORT>
Database: <YOUR_DB_NAME>
User: <YOUR_DB_USER>
Password: <YOUR_DB_PASSWORD> (stored encrypted)
Press Test Connection to verify the driver loads and the credentials work. If the test succeeds, click OK to save the data source. The connection now appears in the database tree.
Step 2 – Run a Query with Pagination
Right‑click the data source and choose New → Console to open a SQL editor. Write a query that returns more than 100 rows, for example:
SELECT * FROM users ORDER BY id ASC;
Press Ctrl+Enter (or click the run button) to execute. The results appear in a grid below. If the result set is large, IntelliJ will automatically fetch only the first page. At the bottom of the grid you’ll see:
- Prev page / Next page buttons
- A Page size drop‑down (default 100 rows)
- Current page number and total rows (if known)
Click Next page to load the following 100 rows. The IDE uses LIMIT/OFFSET under the hood, so the server only sends the requested slice. If your database doesn’t support this syntax (e.g., very old Oracle), the IDE falls back to fetching the entire result set, which may freeze the UI.
Step 3 – Edit Data Inline
Double‑click a cell in the result grid. The cell turns into an editor. Modify the value and press Enter. A pop‑up appears asking you to Commit or Rollback the change. The IDE stages the update in a local buffer; no data is written until you confirm. This is effectively a lightweight transaction:
- Change the cell value.
- Click Commit in the dialog.
- The IDE sends an
UPDATEstatement to the database. - Refresh the grid to see the updated value.
Be careful: uncommitted changes remain in the buffer and will be lost if you close the console. Always review the commit dialog before confirming.
Trade‑offs and Limitations
| Feature | What to Watch For |
|---|---|
| Large Result Sets | Even with pagination, fetching millions of rows can cause UI lag or out‑of‑memory errors. Use WHERE clauses or LIMIT to reduce the result size. |
| Pagination Support | Depends on LIMIT/OFFSET support. Older Oracle versions may not paginate, leading to full fetch. |
| Inline Editing | Changes are applied immediately on commit. Wrap edits in a transaction if you need rollback after multiple changes. |
| Credential Storage | Encrypted in the IDE’s settings file. Do not share project files containing passwords. |
| ER Diagram Rendering | Complex schemas with circular references may not display correctly. |
Practical Verification Checklist
- Open
Databasetool window and create a JDBC connection. - Run a
SELECTthat returns >100 rows and confirm pagination controls appear. - Edit a cell, confirm the commit dialog, and verify the change persists after a refresh.
- Open the
Settings → Password Safepage and confirm your password is stored encrypted (asterisks). - Install the
Database Navigatorplugin, add a MongoDB data source, and repeat the steps to test plugin extensibility.
Actionable Take‑away
If you’re already using IntelliJ IDEA, enable the built‑in Database Tools and give them a try on a test database. The next time you need to verify a query, tweak a row, or explore a schema, you’ll do it in the same window you’re editing code, saving time and reducing the risk of credential leaks.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.