GeeCON Prague 2014*
The moose likes JDBC and the fly likes Post connection query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Post connection query" Watch "Post connection query" New topic
Author

Post connection query

Ash Jose
Greenhorn

Joined: Feb 14, 2009
Posts: 7
Hi,

I have defined a datasource to connect to Sybase DB. I need to run an authentication statement (SET TEMPORARY OPTION CONNECTION_AUTHENTICATION=....) after connection to keep the connection alive, else DB server will drop the connection after 10 seconds.

Is there a way to specify to run this in the connection parameters (DBCP params) so that all the connection in the pool have this authentication statement executed.

Thanks,
-ash
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

and you can't set this in the connection url?
Ash Jose
Greenhorn

Joined: Feb 14, 2009
Posts: 7
Wendy Gibbons wrote:and you can't set this in the connection url?


How do I set this in connection URL?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

alongside the username and password and other settings like schema you just pop in CONNECTION_AUTHENTICATION=xxx
worth a try;
 
GeeCON Prague 2014
 
subject: Post connection query