Eclipse SQL Formatter Alternative — Free, No Plugin Install
Table of Contents
Eclipse has been the default Java IDE for over two decades. Java developers writing JDBC, JPA, Hibernate, MyBatis, or Spring Data JPA queries often have raw SQL embedded in their code. Eclipse has no built-in SQL formatter — you have to install DBeaver as an Eclipse plugin (which adds a 200MB download), or use the Quantum DB plugin (last updated 2017), or hand-format SQL.
The browser tool covers the gap. Format your SQL in a browser tab, paste back into your Java file. No plugin install, no DBeaver footprint inside Eclipse, no abandoned plugins to debug.
Why Eclipse SQL Plugins Are Awkward in 2026
Eclipse SQL plugin options today:
- DBeaver Eclipse plugin — adds the full DBeaver suite to Eclipse. Works well but ~200MB download and adds a lot of features you may not need.
- Quantum DB — abandoned, last updated 2017. Does not work cleanly on modern Eclipse.
- SQL Explorer — abandoned, hosted on SourceForge.
- Toad Extension for Eclipse — paid Toad license required.
- RDT (Rapid Development Tools) — niche, limited dialect support.
The Eclipse SQL ecosystem has been declining for years as developers migrated to IntelliJ IDEA and VS Code. Most Java developers who want serious database tools install DBeaver as a standalone app, not as an Eclipse plugin.
For occasional SQL formatting in Java code, the browser tool is faster than installing DBeaver inside Eclipse.
How to Format SQL Embedded in Java Code
Java developers embed SQL in several ways:
JDBC raw strings:
String sql = "SELECT id FROM users WHERE status = ?"- Format the content of the string (without the surrounding quotes), then paste back.
Java text blocks (Java 15+):
- Triple-quoted strings preserve formatting.
- Format the SQL externally, paste into the text block.
JPA / Hibernate JPQL queries:
- JPQL is similar to SQL but uses entity names instead of table names.
- The browser formatter handles JPQL with the Standard SQL dialect — minor differences in entity names.
MyBatis XML mappers:
- SQL is embedded in XML, often with dynamic if/foreach tags.
- Format the SQL inside the <select> or <insert> tags. The dynamic tags pass through.
Spring Data JPA @Query annotations:
- SQL strings inside annotations on repository methods.
- Same workflow: copy the SQL out, format, paste back.
The Eclipse-to-Browser Workflow
- Open your Java file in Eclipse.
- Find the SQL string — in a Java string literal, JPA @Query annotation, MyBatis XML mapper, or Hibernate HQL.
- Select just the SQL content — without the surrounding Java syntax.
- Copy with Ctrl+C.
- Switch to your browser tab.
- Paste into the SQL formatter.
- Pick the dialect matching your database — MySQL, PostgreSQL, SQLite, Standard SQL for JPA/HQL.
- Click Format.
- Click Copy.
- Switch back to Eclipse and paste over the original SQL.
For Java text blocks, the formatted multi-line SQL fits cleanly inside the triple-quoted string syntax.
Sell Custom Apparel — We Handle Printing & Free ShippingEclipse vs IntelliJ IDEA for Java Developers Writing SQL
If you write a lot of SQL in your Java code, IntelliJ IDEA Ultimate is genuinely better than Eclipse for this specific use case:
- IntelliJ Ultimate — includes the same database tools as DataGrip, with inline SQL detection in Java strings, schema-aware autocomplete, and inline format. $169/year personal.
- IntelliJ Community — free, but no SQL/database features (same gap as PyCharm Community).
- Eclipse — no native SQL features, plugin ecosystem is in maintenance mode.
The decision: if you write Java with frequent SQL strings, IntelliJ Ultimate at $169/year is worth the upgrade. If you cannot switch IDEs (corporate policy, legacy project) or only write SQL occasionally, the browser tool covers the formatting gap.
Formatting Hibernate-Generated SQL for Debugging
Hibernate has a config option hibernate.format_sql=true that pretty-prints generated SQL in the application logs. The output is decent but uses Hibernate's own formatter, which has its own quirks (every clause on a new line, sometimes excessive indentation).
If you need to read Hibernate-generated SQL during debugging:
- Enable hibernate.format_sql=true in application.properties or hibernate.cfg.xml.
- Reproduce the slow query in your dev environment.
- Copy the formatted SQL from the logs.
- Paste into the browser formatter for cleaner output if Hibernate's formatting is hard to read.
- Run EXPLAIN on the query in your database to understand the execution plan.
Hibernate's format_sql is fine for quick debugging. For sharing in PRs, runbooks, or post-mortems, the browser formatter produces cleaner output.
Other Browser Tools Java Developers Use
Java developers using Eclipse often need formatting for other languages too:
JSON formatter — for inspecting JSON request/response bodies in REST APIs. JSON Formatter.
XML formatter — for Spring config files, MyBatis mappers, and SOAP responses. Same browser tool, accepts XML.
YAML formatter — for Spring Boot application.yml files. YAML Tool.
Code diff checker — for comparing two versions of a Java method. Code Diff Tool.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free SQL FormatterFrequently Asked Questions
Is there a free SQL formatter plugin for Eclipse?
The DBeaver Eclipse plugin is free and includes a SQL formatter, but it adds the full DBeaver suite to Eclipse (~200MB). For occasional formatting, the browser tool is lighter weight.
Does Eclipse have any built-in SQL editing?
No native SQL editor or formatter in Eclipse Java EE or Eclipse for Java Developers. SQL features only come from plugins.
Can I format Hibernate JPQL or HQL queries?
Yes. Pick Standard SQL as the dialect. JPQL and HQL are similar enough to standard SQL that the formatter handles them cleanly. Entity names instead of table names pass through unchanged.
How do I format SQL inside MyBatis XML mappers?
Copy the SQL inside the <select>, <insert>, <update>, or <delete> tags. Format in the browser. Paste back inside the same tags. Dynamic SQL tags like <if> and <foreach> pass through as text.

