Specifying Connection URIs


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 URI depends on whether you are using a built-in JDBC driver or a third-party driver, and the database you are connecting to.

Connection URIs for Built-In Drivers

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

The format of the connection URI is:

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

where:

dbtype
Valid values are db2, informix, mysql, 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 Database 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 URIs for Third-Party Drivers

You can access the PostgreSQL database using the PostgreSQL JDBC driver from:

http://jdbc.postgresql.org/

Connection URI Format

The format of the connection URI 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 URI is an example of the minimum information that must be specified in the URI:

jdbc:postgresql:your_database