EAServer provides application authentication by allowing you to get a JDBC connection for a user name and password that you specify in the source code. This feature is supported for JDBC 2.0 ConnectionPoolDataSources only. This example gets a connection:
_ds = (javax.sql.DataSource) nameCntxt.lookup(“java:comp/env/jdbc/myAlias2DB”); _conn = ds.getConnection(user_name, password); // use the connection _conn.close();
An application authenticated connection acts as a shared connection. Since only a single connection can be enlisted in a transaction, you cannot get two application authenticated connections, with different user name/password combinations in the same transaction. Attempts to do so can lead to unexpected results.
Copyright © 2005. Sybase Inc. All rights reserved. |