Examples

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.

StepsExample: Creating your own instance of GSSManager

  1. 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.

  2. Pass the new GSSManager instance into the GSSMANAGER_CLASS connection property. For example:

    Properties props = new Properties();
    props.put("GSSMANAGER_CLASS", gssMan);
    
  3. Use these connection properties, including GSSMANAGER_CLASS, in your connection. For example:

    Connection conn = DriverManager.getConnection (url, props);
    

StepsExample: Passing a string to GSSMANAGER_CLASS

  1. 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";
    
  2. Pass the string to the GSSMANAGER_CLASS connection property. For example:

    Properties props = new Properties();
    props.put("GSSMANAGER_CLASS", gssManClass);
    
  3. Use these connection properties, including GSSMANAGER_CLASS, in your connection. For example,

    Connection conn = DriverManager.getConnection (url, props);