Typically, you can configure a connection pool to provide scalability for connections. In addition, to help minimize the number of connections required in a connection pool, you can switch the user associated with a connection to another user, a process known as
reauthentication.
For example, suppose you are using Kerberos authentication to authenticate users using their operating system user name and password. To reduce the number of connections that must be created and managed, you can use reauthentication to switch the user associated with a connection to multiple users. For example, suppose your connection pool contains a connection, Conn, which was established by the user ALLUSERS. That connection can service multiple users (User A, B, and C) by switching the user associated with the connection Conn to User A, B, and C.
The following table shows the support for reauthentication and lists the required database permissions. Refer to your database documentation for information about granting permissions.
To perform reauthentication on a connection explicitly, call the setCurrentUser() method in the ExtConnection interface located in the com.ddtek.jdbc.extensions package. For example, the following code switches the user on the connection from the user that created the connection (
TEST) to a new user (
SMITH). In addition, it sets options that switch the current schema and current database path to the schema and database path of the new user.
If you are using the DataDirect Connection Pool Manager for connection pooling, you can enable reauthentication in the Pool Manager. Refer to
Connection Pool Manager in the
DataDirect Connect Series for JDBC Reference for details.