Properties props = new Properties(); props.setProperty(JNDI_PROVIDER, provider); props.setProperty(JNDI_PRINCIPAL, principal); props.setProperty(JNDI_CREDENTIALS, credentials);
Hashtable props = new Hashtable(); props.put(Context.PROVIDER_URL, provider); props.put(Context.SECURITY_PRINCIPAL, principal); props.put(Context.SECURITY_CREDENTIALS, credentials);
    public static void main( String[] args ) {        String issuerdn = null;        BasicConfigurator.configure();        if ( (args.length != 5) && (args.length != 2) ){            log.error( "Usage: JobRunner <providerurl> <username> <password> <jndiname>  <issuerdn>" );            log.error( "Usage: JobRunner <jndiname> <issuerdn>" );            return;        }        JobRunner runner = null;        String job = null;        try {            if (args.length == 4) {                String provider = args[0];                String principal = args[1];                String credentials = args[2];                job = args[3];                issuerdn = args[4];                Properties props = new Properties();                props.setProperty(JNDI_PROVIDER, provider);                props.setProperty(JNDI_PRINCIPAL, principal);                props.setProperty(JNDI_CREDENTIALS, credentials);                runner = new JobRunner(props);            } else {                job = args[0];                issuerdn = args[1];                runner = new JobRunner();            }            if (job != null) {                runner.runJob(job, issuerdn);            }        } catch (Exception e) {            log.error("Error running job " + job, e);        }    }