Jdbc - URL (and Driver Class)

Jdbc Class Architecture

Jdbc - URL (and Driver Class)

About

JDBC is using URL to locate the database schema.

Database URLs are strings that you specify for the value of the url property of the DataSource object.

You can add to all JDBC URL, the user and the password in the query part. Example

jdbc:subProtocol://hostname;user=[userName];password=[userPassword];DatabaseName=[Databasename]

The userName and the userPassword must be encoded as all query properties.

URL

The getConnection function gives the following format for the beginning of the string.

jdbc:subprotocol:subname

The format of a url is DB-specific but many follows the following syntax:

jdbc:subprotocol:uri
# ie 
jdbc:subprotocol:scheme://autority....

where:

Default Values

Hyperion

Microsoft SQL Server 2005

  • driver= hyperion.jdbc.sqlserver.SQLServerDriver
  • url= jdbc:hyperion:sqlserver://[hostname]:[port];DatabaseName=[Databasename]

Microsoft SQL Server 2000

  • driver= hyperion.jdbc.sqlserver.SQLServerDriver
  • url= jdbc:hyperion:sqlserver://[hostname]:[port];DatabaseName=[Databasename]

IBM Db2 Universal Database version 9

  • driver= hyperion.jdbc.db2.DB2Driver
  • url= jdbc:hyperion:db2://[host]:[port];DatabaseName=[dbname]

IBM Db2 Universal Database version 8

  • driver= hyperion.jdbc.db2.DB2Driver
  • url= jdbc:hyperion:db2://[host]:[port];DatabaseName=[dbname]

Sybase Adaptive Server Enterprise 15

  • driver= hyperion.jdbc.sybase.SybaseDriver
  • url= jdbc:sybase:Tds:[host]:[port]

DB2

  • jar: db2java.zip

Odbc Bridge

see JDBC - ODBC bridge

  • Driver Class= sun.jdbc.odbc.JdbcOdbcDriver
  • Jdbc Url= jdbc:odbc:[dsn]

Oracle

Oracle Maven Repository

Oracle 11g

  • Driver Class= oracle.jdbc.OracleDriver
  • url= jdbc:oracle:thin:@[host]:[port]:[sid] (connection by SID is deprecated)
  • url= jdbc:oracle:thin:@[host]:[port]/[servicename]
  • jar: ojdbc6.jar

The colon “:” implies SID, the slash “/” implies service_name.

Example:

jdbc:oracle:thin:scott/tiger@myhost:1521:mysid

Oracle 10g

  • driver= oracle.jdbc.OracleDriver
  • url= jdbc:oracle:thin:@[host]:[port]:[sid]

Oracle 9i

  • driver= oracle.jdbc.OracleDriver
  • url= jdbc:oracle:thin:@[host]:[port]:[sid]

Oracle BI Server (OBIEE)

  • driver= oracle.bi.jdbc.AnaJdbcDriver
  • url= jdbc:oraclebi://[host]:[port]/ (default: jdbc:oraclebi://hostName:9703/ )

With user: jdbc:oraclebi://localhost:9703/user=Nico;password=********;

Others parameters:

  • SECONDARYCCSPORT=9706
  • MAXRECONNECTATTEMPTS=3
  • TRUSTANYSERVER=true
  • PRIMARYCCSPORT=9706
  • MAXRPCCLIENTCREATEATTEMPTS=3
  • USER=ngerarlocal
  • HEARTBEATINTERVAL=60
  • MAXHEARTBEATATTEMPTS=3
  • MAXRPCCLIENTCOUNT=100
  • SSL=false
  • TRUSTSTOREPASSWORD=***
  • PASSWORD=***
  • SECONDARYCCS=
  • PORT=9703
  • CATALOG=
  • HOST=localhost
  • PRIMARYCCS=
  • SSLKEYSTOREPASSWORD=***
  • RPCCLIENTEXPIRATIONTIME=60

SQL Server

2008 R2

  • driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
  • url = jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

Example:

jdbc:sqlserver://localhost;user=MyUserName;password=*****;databaseName=AdventureWorks;

  • jar: sqljdbc.jar

Sybase IQ 12

  • driver= om.sybase.jdbc3.jdbc.SybDriver
  • url= jdbc:sybase:Tds:[host]:[port]?ServiceName=[database_name]

Informix IDS 10.0

  • driver= com.informix.jdbc.IfxDriver
  • url= jdbc:informix-sqli://[host_name]:[port_number]/[database_name]:INFORMIXSERVER=[server_name]

Informix IDS 9.4

  • driver= com.informix.jdbc.IfxDriver
  • url= jdbc:informix-sqli://[host_name]:[port_number]/[database_name]:INFORMIXSERVER=[server_name]

Teradata

  • jar: terajdbc4.jar, log4j.jar, teradata.jar, tdgssjava.jar, tdgssconfig.jar

NCR Teradata 12.0

  • driver= com.ncr.teradata.TeraDriver
  • url= jdbc:teradata://[DatabaseServerName]

NCR Teradata V2R6.2

  • driver= com.ncr.teradata.TeraDriver
  • url= jdbc:teradata://[DatabaseServerName]

NCR Teradata V2R5.1

  • driver= com.ncr.teradata.TeraDriver
  • url= jdbc:teradata://[DatabaseServerName]

MySQL

MySQL 5.0

  • driver= com.mysql.jdbc.Driver
  • url= jdbc:mysql://[host]:[port]/[database]
  • jar: Mysql-connector-java*.jar

MySQL 4.1

  • driver= com.mysql.jdbc.Driver
  • url= jdbc:mysql://[host]:[port]/[database]

Netezza 4.0

  • driver= org.netezza.Driver
  • url= jdbc:netezza://[host]:[port]/[database]

TimesTen

The driver= com.timesten.jdbc.TimesTenDriver. The jar driver is located int the TIMESTEN_BASE\lib directory. The jar file ttjdbc5.jar is for the Java SDK version 5 and ttjdbc6.jar is for version 6. (ttjdbc5.jar, ttjdbc6.jar)

URL:

jdbc:timesten:{direct|client}:dsn=DSNname;[DSNattributes;]

Example:

jdbc:timesten:client:dsn=TT_DATA_STORE;UID=login;Pwd=pwd;SQLQUERYTIMEOUT=0

RPAS 13.0.1 int1

  • driver= jdbc.sql.oadriver
  • url= jdbc:OpenRDA:[DSN Name]

Java DB - Derby

Embedded

For the Embedded configuration

  • Driver: org.apache.derby.jdbc.EmbeddedDriver.
  • URL: jdbc:derby:databaseName;URLAttributes where:
    • databaseName. The name of the database that you want to connect to
    • URLAttributes. One or more of the supported attributes of the database connection URL, such as ;territory=ll_CC or ;create=true.

Client/server

For the client/server communication:

  • Driver: org.apache.derby.jdbc.ClientDriver.
  • URL: jdbc:derby://server[:port]/databaseName[;URLAttributes=value[;...]] where:
    • the server and port specify the host name (or IP address) and port number where the server is listening for requests
    • databaseName is the name of the database you want to connect to.
    • URLAttributes can be either Derby embedded or network client attributes.

Documentation / Reference





Discover More
Card Puncher Data Processing
Hive - URI (Connection URL )

cliservice/confhive.server2.thrift.http.path transportMode : . Default port for HTTP transport mode is 10001. See conf hive.server2.thrift.http.port clientURI Zookeeper Quorum Headnode (Example...
Download Jdbc Cassandra
How to connect to Cassandra Cloud AstraDb with JDBC ?

This article shows you how you can connect to an AstraDb database with Jdbc. Download the JDBC driver at datastax Create a new driver with...
Jdbc Class Architecture
JDBC - Oracle

Definition of the JDBC Oracle API or how to connect to a JDBC oracle and made database operations. A simple application includes the following classes: DataHandler.java. This class contains all...
Jmeter Classpath
JMeter - JDBC Request

Basic information on the JDBC Request. In the Test Plan Node, You can add you JDBC Driver or in the directory Jmeter_Home/lib Simple Test Plan: A Thread Group A A JmComp>#JDBC Connection...
Jdbc Class Architecture
Jdbc - Driver Manager

java/sql/DriverManagerDriverManager JDBC 4.1 specification, when the DriverManager is trying to establish a connection: it calls the driver’s connect method and passes the URL. If the Driver...
Bi Server Architecture With Client
OBIS - JDBC

This page is how to use Oracle Bi Server as a data source via JBDC. It's possible to make a connection with the presentation layer of the repository through JDBC and to query it via the For a step...
Timesten Component
Timesten - Direct Connection

When the client application resides on the same machine as the TimesTen Server, you can use shared memory for the inter-process communication (IPC). The best response time is achieved with TimesTen running...
Web Resource - Scheme

A scheme is the first part of an URI. It refers to a network protocol (called also specification) that should be used to communicate with the service defines in the authority part of the URL The scheme...



Share this page:
Follow us:
Task Runner