Using trusted connections in JDBC
In the previous recipe, we saw why trusted contexts are needed and we also saw how to create a trusted context. Once a trusted context is created, it can be used in various languages to create trusted connections. The infrastructure to create trusted connections is provided by the database drivers for that language. DB2 provides the following drivers that support trusted connections (as of DB2 9.7 GA):
- IBM DB2 Driver for JDBC and SQLJ (Type-4 and Type-2 connectivity)
- IBM_DB Driver for Ruby
- IBM Data Server Provider for .NET
ibm_db2
Driver for PHP- CLI/ODBC
In this recipe, we will see how we can establish trusted connections in Java and switch user IDs within a connection. In this recipe, we will use the IBM DB2 driver ...
Get IBM DB2 9.7 Advanced Application Developer Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.