You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
526 B
Java

JndiUtil
package com.ack.util;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class JndiUtil {
private static Context ctx;
public static void init( Context theContext ) throws NamingException {
if( ( JndiUtil.ctx = theContext ) == null ) {
JndiUtil.ctx = new InitialContext();
}
}
public static Object getJndiEntry( String jndiEntry )
throws NamingException {
return ctx.lookup( jndiEntry );
}
}