1 6 7 package org.jfox.jndi; 8 9 import javax.naming.Context ; 10 import javax.naming.InitialContext ; 11 import javax.naming.NamingException ; 12 13 16 17 public class InitialContextHelper { 18 private static volatile Context initCtx; 19 20 public static Context getInitialContext() { 21 if(initCtx == null) { 22 try { 23 initCtx = new InitialContext (); 24 } 25 catch(NamingException e) { 26 e.printStackTrace(); 27 } 28 } 29 return initCtx; 30 } 31 32 public static void main(String [] args) { 33 34 } 35 } 36 | Popular Tags |