JDBC Sürücü URL’leri

Java’da farklı veritabanları ile çalışırken url’leri hatırlamak zor olabiliyor. Sık kullanılanların bazılarından bir derleme yaptım.

MySQL (Connector/J)

Driver Class: com.mysql.jdbc.Driver
Default Port: 3306

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

mysql driver page | property listesi

PostgreSQL

Driver Class: org.postgresql.Driver
Default Port: 5432

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

postgres driver page

Firebird SQL

Driver Class: org.firebirdsql.jdbc.FBDriver
Default Port: 3050

jdbc:firebirdsql:host/port:database?lc_ctype=UTF8
jdbc:firebirdsql:localhost/3050:/firebird/test.gdb?lc_ctype=UTF8

jaybird faq

HSQL

Driver Class: org.hsqldb.jdbcDriver

jdbc:hsqldb:mem:
jdbc:hsqldb:file:/opt/db/accounts
jdbc:hsqldb:res:/adirectory/dbname
jdbc:hsqldb:hsql://host:port/database
jdbc:hsqldb:hsqls://host:port/database
jdbc:hsqldb:http://host:port/database
jdbc:hsqldb:https://host:port/database

hsql url & protokolleri | hsqldb.org

Microsoft SQL Server (jTDS Driver)

Driver Class: net.sourceforge.jtds.jdbc.Driver
Default Port: 1433

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

property listesi | jTDS page

Microsoft SQL Server (Microsoft Driver)

Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
Default Port: 1433

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

mssql page

Yazının bir kısmı Pete Freitag‘ın blogundan alıntıdır.