Entering content frame

 Specifying Other Connection Options 

Use

You can use connection options to define the properties of a database instance connection.

Procedure

Usually, an instance of the class java.util.Properties is used to send the connection options to the method java.sql.DriverManager.getConnection.

However, you can also specify these options as part of the connection URL. In this case, you must specify them with the following format:

<name>=<value>[&<name>=<value>...]

You can define the following options:

Option

Description

user

Name of the database user

password

User password

sqlmode

SQL mode
Possible values are
ORACLE | INTERNAL
The system default is
INTERNAL.

cachelimit

Cache limit of the connection

timeout

Command timeout of the connection (in seconds)

isolation

Isolation level of the connection
In the Java method, you can specify the isolation level either as a character string or an integer, as declared in the class
java.sql.Connection. The following character strings are possible: TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE

autocommit

AUTOCOMMIT mode

Possible values:
on: A COMMIT is performed after every command.
off: Transactions must be controlled with the methods commit () and rollback ().

The system default is on.

reconnect

RECONNECT mode
Possible values:
on: The system connects to the database instance again automatically after a command timeout.
off: There is no automatic new connection.

The system default is on.

trace

Name of the file for the debug output

tracesize

Maximum number of lines in the file for the debug output. If this number is exceeded, the content of the file is overwritten cyclically.

cache

The internal information used by objects in the class java.sql.PreparedStatement is saved in the connection object. If more objects are generated by the same SQL statement in the same class, then this internal information can be used again, and no new request needs to be sent to the database.

Possible values:
all: All SQL statements are saved.
Or a combination of
s (for SELECT), i (for INSERT), u (for UPDATE), d (for DELETE): Only SQL statements of the specified type are saved.

cache=iud

Only INSERT, UPDATE, and DELETE statements are saved.

unicode

The user name, password and SQL statements are sent to the database in UNICODE.

 

See also:

Examples for Connecting to the Database

 

Leaving content frame