I want to return true and false from the function below, does this function will automatically returns true or I have to write return statement
public boolean connection()
{
Hashtable env = new Hashtable(11);
env.put(Context .INITIAL_CONTEX T_FACTORY,"com. sun.jndi.ldap.L dapCtxFactory") ;
env.put(Context .PROVIDER_URL, "ldap://ad.infosys.com: 389");
env.put(Context .SECURITY_AUTHE NTICATION, "simple");
env.put(Context .SECURITY_PRINC IPAL, userid+"@ad.inf osys.com");
env.put(Context .SECURITY_CREDE NTIALS,pwd);
DirContext ctx = new InitialDirConte xt(env);
ctx.close();
}
public boolean connection()
{
Hashtable env = new Hashtable(11);
env.put(Context .INITIAL_CONTEX T_FACTORY,"com. sun.jndi.ldap.L dapCtxFactory") ;
env.put(Context .PROVIDER_URL, "ldap://ad.infosys.com: 389");
env.put(Context .SECURITY_AUTHE NTICATION, "simple");
env.put(Context .SECURITY_PRINC IPAL, userid+"@ad.inf osys.com");
env.put(Context .SECURITY_CREDE NTIALS,pwd);
DirContext ctx = new InitialDirConte xt(env);
ctx.close();
}
Comment