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.
Database | Driver class name | JDBC URL Example | JDBC URL Links | validation Query recommendation |
---|---|---|---|---|
Apache Derby | org.apache.derby.jdbc.EmbeddedDriver | jdbc:derby:[subsubprotocol:]MYDATABASE | Derby JDBC database connection URL | |
MySQL | com.mysql.jdbc.Driver | jdbc:mysql://myserver:3306/MYDATABASE | Connector/J Reference | SELECT 1 |
MS SQL Server | com.microsoft.sqlserver.jdbc.SQLServerDriver | jdbc:sqlserver://myserver:1433;databaseName=MYDATABASE | Building the Connection URL | SELECT 1 |
Oracle | oracle.jdbc.driver.OracleDriver | jdbc:oracle:thin:@myserver:1521:MYTNS | Oracle JDBC Driver and URL Information (@razorsql.com) | SELECT SYSDATE FROM DUAL |
PostgreSQL | org.postgresql.Driver | jdbc:postgresql://myserver:5432/MYDATABASE | SELECT 1 | |
SQLite | org.sqlite.JDBC | jdbc:sqlite:/var/foo/MYDATABASE.db | - |