DEVFYI - Developer Resource - FYI

Can I set up a conection pool with multiple user IDs? The single ID we are forced to use causes probelems when debugging the DBMS.

JDBC Interview Questions and Answers


(Continued from previous question...)

Can I set up a conection pool with multiple user IDs? The single ID we are forced to use causes probelems when debugging the DBMS.

Since the Connection interface ( and the underlying DBMS ) requires a specific user and password, there's not much of a way around this in a pool. While you could create a different Connection for each user, most of the rationale for a pool would then be gone. Debugging is only one of several issues that arise when using pools.
However, for debugging, at least a couple of other methods come to mind. One is to log executed statements and times, which should allow you to backtrack to the user. Another method that also maintains a trail of modifications is to include user and timestamp as standard columns in your tables. In this last case, you would collect a separate user value in your program.

(Continued on next question...)

Other Interview Questions