You can use connection options to define the properties of a database instance connection.
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 |
cachelimit |
Cache limit of the connection |
timeout |
Command timeout of the connection (in seconds) |
isolation |
Isolation
level of the connection |
autocommit |
AUTOCOMMIT mode Possible values: The system default is on. |
reconnect |
RECONNECT mode 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: 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