JDBC Connection URLs for 22 Databases
Saturday, 8 August 2009
Here is a non-exhaustive list of JDBC connection URLs for various databases. Corrections welcome!
Microsoft SQL Server JDBC connection URL
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=northwind com.microsoft.jdbc.sqlserver.SQLServerDriver msbase.jar;mssqlserver.jar;msutil.jar downloadl
Microsoft SQL Server 2005 JDBC connection URL
jdbc:sqlserver://serverName\instance:port[;user=value][;password=value][;property=value] com.microsoft.sqlserver.jdbc.SQLServerDriver sqljdbc.jar download SQL Server 2005 driver
Microsoft SQL Server (JTurbo) JDBC connection URL
jdbc:JTurbo://<HOST>:<PORT>/<DB> com.ashna.jturbo.driver.Driver
Microsoft SQL Server (Sprinta) JDBC connection URL
jdbc:inetdae7:<HOST>:<PORT>?database=<DB> com.inet.tds.TdsDrive download
Cloudscape JDBC connection URL
jdbc:cloudscape:MyDataBase COM.cloudscape.core.JDBCDriver
Cloudscape RMI JDBC connection URL
jdbc:rmi://hostname:portnumber/jdbc:cloudscape:MyDatabase RmiJdbc.RJDriver
Hypersonic SQL (server) JDBC connection URL
jdbc:hsqldb:hsql://localhost org.hsqldb.jdbcDriver hsqldb.jar download (SourceForge)
Hypersonic SQL (in-process) JDBC connection URL
jdbc:hsqldb:file:/opt/db/testdb org.hsqldb.jdbcDriver hsqldb.jar
Hypersonic SQL (in-memory) JDBC connection URL
jdbc:hsqldb:mem:aname org.hsqldb.jdbcDriver hsqldb.jar
H2 Database (embedded)
jdbc:h2:test
H2 Database (Client Server)
jdbc:h2:tcp://localhost:9092/test
H2 Database (Client Server, Clustered)
jdbc:h2:tcp://localhost:9092,backuphost.com:9092/test
H2 Database (In Memory)
jdbc:h2:{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]
Informix JDBC connection URL
jdbc:informix-sqli://hostname:portnumber/MyDatabase:INFORMIXSERVER=MyServerName com.informix.jdbc.IfxDriver
MySQL JDBC connection URL
jdbc:mysql:///test jdbc:mysql://[host][,failoverhost...][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]... com.mysql.jdbc.Driver
Oracle JDBC connection URL
jdbc:oracle:thin:@localhost:1521:MyDatabase oracle.jdbc.driver.OracleDriver classes12.zip
To reference the Oracle SID (Service name), you have to apply // in front of the host name.
jdbc:oracle:thin:myusername/mypassword@//localhost:1521/PROD.OCZH.CH
To connect to your database using a tnsnames.ora entry,
System.setProperty("oracle.net.tns_admin",
"D:\\oracle\\product\\10.2.0\\db_1\\NETWORK\\ADMIN");
or
Doracle.net.tns_admin=D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN
jdbc:oracle:thin:@mysvcname
PostgresSQL JDBC connection URL
jdbc:postgresql:template1 org.postgresql.Driver
DB2 JDBC connection URL
jdbc:db2:test com.ibm.db2.jdbc.app.DB2Driver
TimesTen in-memory database JDBC connection URL
jdbc:timesten:direct:test com.timesten.jdbc.TimesTenDriver
DB2/400 (native) JDBC connection URL
jdbc:db2://systemname com.ibm.db2.jdbc.app.DB2Driver
DB2/400 (toolbox) JDBC connection URL
jdbc:as400://systemname com.ibm.as400.access.AS400JDBCDriver
Derby JDBC connection URL
jdbc:derby:/test;create=true org.apache.derby.jdbc.EmbeddedDriver
Derby JDBC network connection URL
jdbc:derby://localhost:1527/sample;user=judy;password=no12see jdbc:derby://localhost:1527/c:/my-db-dir/my-db-name;user=judy;password=no12see org.apache.derby.jdbc.ClientDriver
Note that authentication is off by default. To enable user authentication, the property derby.connection.requireAuthentication must be set to true. This is set in the derby.properties file.
Sybase JDBC connection URL
jdbc:sybase:Tds:localhost:2048/MyDatabase com.sybase.jdbc2.jdbc.SybDriver jconn2.jar download
Mckoi SQL JDBC connection URL
jdbc:mckoi:local://C:/mckoi1.0.3/db.conf com.mckoi.JDBCDriver
SAP DB JDBC connection URL
jdbc:sapdb://localhost/TST com.sap.dbtech.jdbc.DriverSapDB
JSQL JDBC connection URL
jdbc:JSQLConnect://localhost/test com.jnetdirect.jsql.JSQLDriver
JTurbo JDBC connection URL
jdbc:JTurbo://localhost:1433/test com.newatlanta.jturbo.driver.Driver
jTDS JDBC connection URL
jdbc:jtds:sqlserver://localhost/dbName;instance=instanceName net.sourceforge.jtds.jdbc.Driver
(thanks JoelN for the correction)
Interbase (Java driver) JDBC connection URL
jdbc:firebirdsql:localhost/3050:/firebird/test.gdb org.firebirdsql.jdbc.FBDriver
Interbase (Interclient driver) JDBC connection URL
jdbc:interbase://localhost:3060/C:/firebird/test.gdb interbase.interclient.Driver
PointBase JDBC connection URL
jdbc:pointbase:embedded:sample com.pointbase.jdbc.jdbcUniversalDriver
Ingres JDBC connection URL
ca.edbc.jdbc.EdbcDriver
jdbc:edbc://localhost:II7/database
Mimer SQL JDBC connection URL
jdbc:mimer:multi1 com.mimer.jdbc.Driver
Sources
You should follow me on twitter here
No. 1 — June 1st, 2006 at 11:01 am
[...] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Leave a Reply Show some love for the intense, above par,voluminous, and considerable Wordpress Spam-be-gone plugin? Please enable javascript and reload this page to add your comment. [...]
No. 2 — September 19th, 2008 at 2:43 am
Here is the JDBC – ODBC Bridge connection string:
Connection string = jdbc:odbc:
Driver = sun.jdbc.odbc.JdbcOdbcDriver
No. 3 — April 5th, 2009 at 2:04 am
Apparently the JTDS driver needs a different format for the instance name.
jdbc:jtds:sqlserver://serverName:1433/dbName;instance=instanceName
No. 4 — April 5th, 2009 at 9:08 pm
Thank you. Fixed.
No. 5 — June 29th, 2009 at 9:50 am
[...] Mais informações podem ser obtidas em: redmountainsw [...]
No. 6 — August 16th, 2009 at 3:43 am
Wanted to comment on Chrome Loveliness, but comments are closed there. You can do the same in Firefox with Ctrl-left-click on the back button.
No. 7 — September 10th, 2009 at 1:36 pm
For the sysbase connection
For some cases we need to change localhost -> pcname and it works.
No. 8 — September 25th, 2009 at 5:08 am
Thank you for putting this list together and share us. I was having a problem with jtds jdbc connection and was able to fix it.
No. 9 — November 6th, 2009 at 3:30 am
Thank you so much!! It saved me 20 minutes of my life!
No. 10 — February 18th, 2010 at 4:10 am
[...] JDBC Connection URLs for 22 Databases | Chui’s counterpoint (tags: database jdbc oracle db development java connection url) Si vous avez aimé ce billet, diffusez le en utilisant les services suivants : [...]
No. 11 — February 20th, 2010 at 11:18 pm
Hi, thanks for referencing in your blog entry my Blog :-)