Specifying Connection URLs


DataDirect XQuery provides access to most databases through built-in JDBC drivers. In addition, you can access specific databases using third-party JDBC drivers. The format of the connection URL depends on whether you are using a built-in JDBC driver or a third-party driver, and the database you are connecting to.

Connection URLs for Built-In Drivers

DataDirect XQuery provides built-in JDBC drivers to access the following databases:

The format of the connection URL is:

jdbc:xquery:dbtype://server_name:port;property=value[;...] 

where:

dbtype
Valid values are db2, informix, oracle, sqlserver, and sybase.
server_name
The TCP/IP address or TCP/IP host name of the database server to which you are connecting (See following NOTE).
port
The number of the TCP/IP port.
property=value
Connection properties. For a list of connection properties, ordered by database, see "Connection Properties". For some databases, particular connection properties are required in the URL as shown in the following examples.
All connection property names are case-insensitive. For example, password is the same as Password.
NOTE FOR ORACLE USERS: See "Using Oracle tnsnames.ora Files" for instructions on retrieving connection information from an Oracle tnsnames.ora file.

The following URLs show examples of the minimum information, including any required connection properties, that must be specified in a connection URL.

DB2 for Linux/UNIX/Windows

jdbc:xquery:db2://server_name:50000;databaseName=your_database 

DB2 for z/OS and iSeries

jdbc:xquery:db2://server_name:446;locationName=db2_location 

Informix

jdbc:xquery:informix://server_name;1526;InformixServer=dbserver_name 

Microsoft SQL Server

jdbc:xquery:sqlserver://server_name:1433 

MySQL Enterprise

jdbc:xquery:mysql://server_name:[port] 

Oracle

jdbc:xquery:oracle://server_name:1521 

Sybase

jdbc:xquery:sybase://server_name:5000 

Connection URLs for Third-Party Drivers

You can access the following databases using a third-party JDBC driver:

MySQL Community Server

The format of the connection URL is:

jdbc:mysql://[server_name][,alternate_server[...]][:port]/[database]
[?property=value][&property=value[...]] 

where:

server_name
The TCP/IP address or TCP/IP host name of the database server to which you are connecting. If an address or a host name is not specified, the value defaults to an address of 127.0.0.1.
alternate_server
The TCP/IP address or TCP/IP host name of an alternate database server that can be used for connection failover if the primary database server cannot be used to establish the connection. Refer to your MySQL Connector/J documentation for information about using connection failover with the driver.
port
The number of the TCP/IP port. If a port is not specified, the connection URL defaults to a value of 3306.
database
The name of the database to connect to.
property=value
Connection properties. Refer to your MySQL Connector/J documentation for information about the connection properties supported by the driver.

The following URL is an example of the minimum information that must be specified in the URL:

jdbc:mysql:// 

PostgreSQL

The format of the connection URL is:

jdbc:postgresql:database 

or

jdbc:postgresql://[server_name][:port]/database[?property=value]
[&property=value[...]] 

where:

server_name
The TCP/IP address or TCP/IP host name of the database server to which you are connecting. If an IPv6 TCP/IP address is specified, it must be enclosed within brackets. For example:
jdbc:postgresql://[::1]:5432/accounting
If an address or a host name is not specified, the value defaults to a host name of localhost.
port
The number of the TCP/IP port. If a port is not specified, the value defaults to 5432.
database
The name of the database you are connecting to.
property=value
Connection properties. Refer to your PostgreSQL JDBC driver documentation for information about the connection properties supported by the driver.

The following URL is an example of the minimum information that must be specified in the URL:

jdbc:postgresql:your_database