Java JDBC: List of Drivers and URL for all databases

In this article, we will list down all drivers and URL formation for all leading databases


Q) How to get Connection object for interacting with Database ?

  • DriverManager class helps to get connection object using one of the overloaded static getConnection() methods i.e.;
    getConnection(String dbURL);
    getConnection(String dbURL, Properties props);
    getConnection(String dbURL, String username, 
    		String password);
  • Using connection, user can create SQL statement and then execute SQL queries against database

Q) How to load driver ?

  • Before getting connection object, appropriate driver needs to be loaded using either of the following methods,
  • There are 3 ways to create connection objects from overloaded static getConnection() methods available in the DriverManager class and all 3 requires database URL
  • Therefore, we will look into driver class name and their corresponding database URL formation in tabular form,


Database, driver and URL with example :

Relational Database
Driver Name
(qualified class name)

Database URL & Example
MySQL com.mysql.jdbc.Driver jdbc:mysql://<server>

Eg: jdbc:mysql://localhost

Oracle oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@<server>

Eg: jdbc:oracle:thin:@localhost

IBM DB2 App jdbc:db2:<databaseName>

Eg: jdbc:db2:myDBName

IBM DB2 Net jdbc:db2//<server>

Eg: jdbc:db2://localhost:6789/myDBName

Sybase com.sybase.jdbc.SybDriver jdbc:sybase:Tds:<server>

Eg: jdbc:sybase:Tds:localhost

Teradata com.teradata.jdbc.TeraDriver jdbc:teradata://<server>

Eg: jdbc:teradata://localhost
, tmode=ANSI, charset=UTF8

Microsoft SQL Server

Eg: jdbc:sqlserver://localhost

Postgre org.postgresql.Driver jdbc:postgresql://<server>

Eg: jdbc:postgresql://localhost

MS Access (JDBC-ODBC Bridge) sun.jdbc.odbc.JdbcOdbcDriver jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};

Eg: jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};

Above things are mandatory for establishing connection with corresponding databases before actually creating/executing any SQL queries


Read Also:




Happy Coding !!
Happy Learning !!

Java JDBC: Core Components
Java JDBC: Driver Types