JDBC connection strings

To connect to a JDBC data source, you must create a connection string.

A Netezza JDBC connection string consists of the following parts in the following order:
  • jdbc:netezza:// (mandatory).
  • A host name (mandatory) and a port number (optional if you are using port 5480), followed by a forward slash (/). If you specify a port number, separate it from the host name with a colon (:).
  • A database name followed by a semicolon (;) (mandatory).
  • Property names and their values, specified as name=value pairs (optional). Separate a name=value pair from the next name=value pair by using a semicolon (;).
An example follows. In the example, main is the host name, and sales is the database name.
jdbc:netezza://main:5490/sales;user=admin;password=password;loglevel=2;logdirpath=C:\
The following table contains the properties and values that you can specify when creating the connection string. The properties and values are not case sensitive.
Table 1. Connection string properties and values
Property Description
applicationName Specifies the application name.
autocommit Specifies whether autocommit applies to the connection. Valid values are true (the default) and false.
batchSize Specifies the number of rows to be fetched in a cycle. The default is 256.
caCertFile Specifies the name of the certificate authority (CA) file that is used to authenticate connections. If you use a CA for authentication, the name of the CA file must match the name that the security administrator defined for the database to which you are attempting to connect. For more information about security and authentication, see the IBM® Netezza® System Administrator’s Guide.
clientHostName Specifies the client host name.
clientUser Specifies the client user.
database Specifies the database name.
DatabaseMetaData Specifies whether you can get metadata information that is not restricted to the current catalog and schema. Valid values are false (the default, meaning that the information is restricted to the current catalog and schema) and true.
description Specifies the description for the data source.
dsn Specifies a data source name. If you specify this property, the connection string properties and values in the nzjdbc.ini file that are associated with that data source are used, unless you specify those properties and values directly in the connection string. For example, if you specify the connection string jdbc:netezza//localhost/dsn=nzsql, the properties and values that are associated with the nzsql data source name in the nzjdbc.ini file are used, unless you specify the properties and values directly in the connection string.

You can create the nzjdbc.ini file by using a GUI on Windows operating systems or command-line prompts on Linux and UNIX operating systems. For information about creating the nzjdbc.ini file, see Configuring the JDBC data source by using an nzjdbc.ini file (Windows) or Configuring the JDBC data source by using an nzjdbc.ini file (UNIX and Linux).

host Specifies the name of the host to connect to.
ignoreUpdateCount Specifies whether the JDBC driver is allowed to export more than two billion rows (the maximum int value). Valid values are off (the default) and on.
krbLoginModule Specifies the entry module name of the set of Kerberos properties from the login.conf file. The JDBC driver uses the login module class to create authentication tickets.
krbSSODelegation Specifies that if you configure an IBM Cognos Business Intelligence application in Kerberos SSO mode, the JDBC driver uses the authentication ticket that the Cognos product provides.
logDirPath Specifies the log directory into which the log files are written.
loggerType Specifies the type to be used for logging. Valid values are TEXT (the default) and HTML.
loginTimeout Specifies the maximum wait time to make a connection. The default is infinite.
logLevel Specifies the log level for the connection. The default is OFF.
port Specifies the port number.
readonly Specifies whether the connection is read only. Valid values are false (the default) and true.
securityLevel Specifies the security level. Values are as follows:
onlySecured
Specifies that only connections that use SSL to encrypt data are accepted. This security level increases security but reduces performance somewhat, because of the necessity of encrypting the data stream.
onlyUnsecured
Specifies that only connections that do not use SSL to encrypt data are accepted. This security level can help increase performance but carries the risks that come with an unencrypted connection.
preferredSecured
Specifies that connections that use SSL are preferred but that a connection is not refused solely because it does not use SSL encryption. This value is the default.
preferredUnsecured
Specifies that connections that do not use SSL are preferred but that a connection is not refused solely because it uses SSL encryption.
schema Specifies the name of the schema within the specified database on the Netezza Performance Server system. This property is used for Netezza Performance Server systems that support multiple schemas within a database. If you do not specify a schema, you connect to the default schema of the database.
Important: Calling the setSchema method to specify a new schema causes all future queries, including those using previously created or prepared Statement objects, to use the new schema. This behavior is different from that documented in the Oracle JDBC specification.
user Specifies the user name to connect to the database.
password Specifies the password for authentication.