问题
I have a datasource that connects to Sybase database. I need to execute the authentication statement (SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company....) after I connect to the database.
Is there any way of executing this statement as part of the validationQuery in the JDBC connection param so that the connection is automatically authenticated?
ANSWER:
I have managed to get answer for this !!!
This can be done by setting it in the connection url with the below parameter
SQLINITSTRING=SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company.......
回答1:
Maybe Sybase login triggers are something you could use. Here the steps i would do:
- Create a stored procedure which is executing your statement
- Create a new dedicated database login
- Assigne the login trigger to the newly created stored procedure.
More information about login triggers you find here: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.sag1/html/sag1/sag1804.htm
来源:https://stackoverflow.com/questions/12778338/jdbc-connection-for-sybase-with-authentication-query