JDBC Snippets

Typical JDBC URLs and validation Queries

The JDBC URL links usually refer to what we presume to be the most recent product version at the time we googled the links, earlier versions might not support all URL parameters.

DatabaseDriver class nameJDBC URL ExampleJDBC URL Linksvalidation Query recommendation
Apache Derbyorg.apache.derby.jdbc.EmbeddedDriver
jdbc:derby:[subsubprotocol:]MYDATABASE
Derby JDBC database connection URL 
MySQLcom.mysql.jdbc.Driverjdbc:mysql://myserver:3306/MYDATABASEConnector/J ReferenceSELECT 1
MS SQL Servercom.microsoft.sqlserver.jdbc.SQLServerDriverjdbc:sqlserver://myserver:1433;databaseName=MYDATABASEBuilding the Connection URLSELECT 1
Oracleoracle.jdbc.driver.OracleDriverjdbc:oracle:thin:@myserver:1521:MYTNSOracle JDBC Driver and URL Information (@razorsql.com)SELECT SYSDATE FROM DUAL
PostgreSQLorg.postgresql.Driverjdbc:postgresql://myserver:5432/MYDATABASE

Connection Parameters

SELECT 1
SQLiteorg.sqlite.JDBCjdbc:sqlite:/var/foo/MYDATABASE.db-