javax.naming.NoInitialContextException: Need to specify class name....
Hi
my program runs in a webserver but today i wanted to write a standalone program with a main method that would just read something from a file and store it in the DB. But when i try to run this stand alone program i get the following errors..
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
I do not get this error when i run code in the webserver and use webpages to kick start the code. Does anybody know what could be the reason? following is the code and it is failing on line 3.
Context initCtx =new InitialContext();
System.out.println("entered here 0");
DataSource dataSource = (DataSource) initCtx.lookup("Admin");//line3
System.out.println("entered here");
Connection conn = dataSource.getConnection();
Thanks

