java/jdbc
author Tomas Zeman <tzeman@volny.cz>
Sun, 25 Aug 2013 21:04:14 +0200
changeset 34 11d20ddca9d8
parent 13 f0e6a4b18ab8
permissions -rw-r--r--
scm/hg-git-rosetta-stone: simplified mapping between hg commands and git commands If you know how to use hg very well and just looking at how to do the same things in git, this page is right for you. Use it like a dictionary hg -> git.

http://www.petefreitag.com/articles/jdbc_urls

Guide to JDBC Driver URL's - MySQL, PostgreSQL, SQL Server, etc

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]...


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

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

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