The following examples illustrate how to create your own instance of GSSManager and how to let jConnect create a GSSManager object when the GSSMANAGER_CLASS connection property is set to a fully qualified class name. Both examples use the Wedgetail GSSManager.
Example: Creating your own instance of GSSManager
Instantiate a GSSManager in your application code. For example:
GSSManager gssMan = new com.dstc.security.kerberos.gssapi.GSSManager();
This example uses the default constructor with no arguments. You can use other vendor-supplied constructors, which allow you to set various configuration options.
Pass the new GSSManager instance into the GSSMANAGER_CLASS connection property. For example:
Properties props = new Properties(); props.put("GSSMANAGER_CLASS", gssMan);
Use these connection properties, including GSSMANAGER_CLASS, in your connection. For example:
Connection conn = DriverManager.getConnection (url, props);
Example: Passing a string to GSSMANAGER_CLASS
In your application code, create a string specifying the fully qualified class name of the GSSManager object. For example:
String gssManClass = "com.dstc.security.kerberos.gssapi.GSSManager";
Pass the string to the GSSMANAGER_CLASS connection property. For example:
Properties props = new Properties(); props.put("GSSMANAGER_CLASS", gssManClass);
Use these connection properties, including GSSMANAGER_CLASS, in your connection. For example,
Connection conn = DriverManager.getConnection (url, props);