After a little bit of research along with help from some of the answers here:
SELECT 1
- H2
- MySQL
- Microsoft SQL Server (according to NimChimpsky)
- PostgreSQL
- SQLite
- Hive
SELECT 1 FROM DUAL
- Oracle
SELECT 1 FROM any_existing_table WHERE 1=0
or
SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
or
CALL NOW()
-
HSQLDB (tested with version 1.8.0.10)
Note: I tried using a
WHERE 1=0
clause on the second query, but it didn’t work as a value for Apache Commons DBCP’svalidationQuery
, since the query doesn’t return any rows
VALUES 1
or SELECT 1 FROM SYSIBM.SYSDUMMY1
- Apache Derby (via daiscog)
SELECT 1 FROM SYSIBM.SYSDUMMY1
- DB2
select count(*) from systables
- Informix