Pete Freitag Pete Freitag

Pete's Guide to JDBC Driver URLs

MySQL (Connector/J)

Driver Class: com.mysql.jdbc.Driver

Default Port: 3306

JDBC URL

jdbc:mysql://[host][,failoverhost...][:port]/[database]
jdbc:mysql://[host][,failoverhost...][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...

List of properties

MySQL Connector/J Page

PostgreSQL

Driver Class: org.postgresql.Driver

Default Port: 5432

JDBC URL

    jdbc:postgresql:database
    jdbc:postgresql://host/database
    jdbc:postgresql://host:port/database
    jdbc:postgresql://host:port/database?user=userName&password=pass
    jdbc:postgresql://host:port/database?charSet=LATIN1&compatible=7.2

PostgreSQL JDBC Driver Page

Microsoft SQL Server (jTDS Driver)

Driver Class: net.sourceforge.jtds.jdbc.Driver

Default Port: 1433

JDBC URL

    jdbc:jtds:sqlserver://server[:port][/database][;property=value[;...]]
    jdbc:jtds:sybase://server[:port][/database][;property=value[;...]]
    jdbc:jtds:sqlserver://server/db;user=userName;password=password

List of URL properties

jTDS Project Page

Microsoft SQL Server (Microsoft Driver)

Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver

Default Port: 1433

JDBC URL

    jdbc:microsoft:sqlserver://host:port;databasename=name;user=yourUser;password=yourPwd

Microsoft SQL Server Driver Page

How to get Started with Microsoft JDBC Driver

Questions, Comments, Additions: Contact Me