Harikrishna kishore Harkala

Greenhorn
+ Follow
since Mar 31, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Harikrishna kishore Harkala

Hi
I am using RAD6. My problem is Server is not starting and Iam getting error like this "The server named websphere6.0 not started correctly".Please let me know the possibilities to get this type of errors and solutions also.
16 years ago
When Iam writing code like given below for datasource access using JNDI

public class DataSourceJNDI {

public static void main(String[] args)throws SQLException,NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
InitialContext ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup("jdbc/CMPDS");
Connection con=ds.getConnection();
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("SELECT NAME,ID,DEPT FROM EMPLOY");
String name=rs.getString("NAME");
String id=rs.getString("ID");
String dept=rs.getString("DEPT");
System.out.println(name);
System.out.println(dept);
System.out.println(id);

}
}
I am getting aruntime exception like this:
Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory. Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:375)
at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:60)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:257)
at javax.naming.InitialContext.init(InitialContext.java:233)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at Ray.DataSourceJNDI.main(DataSourceJNDI.java:25)

Please any one can help me?
16 years ago
Shall I use SCJP vochure to SCWCD exam? Is Price of two Exams are same or different?