gtriant
11-25-2007, 02:14 PM
I use the following code inside my applet to connect to the db.
try {
Context ctx = new InitialContext();
if (ctx == null)
throw new Exception("Error - No Context!!!");
Context envContext = (Context)ctx.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myDB");
con = ds.getConnection();
} catch (Exception e ){
e.printStackTrace();
}
But I am not getting the results that i need inserted, after the applet has finished running. I know almost nothing about applets, so any help is much appreciated!!!
Is it possible for me to connect to the db through an applet loaded on a web page?? Both wep application and db are on the same host. What's wrong with the above code???
PS. I hope this is the right place for the post....
try {
Context ctx = new InitialContext();
if (ctx == null)
throw new Exception("Error - No Context!!!");
Context envContext = (Context)ctx.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myDB");
con = ds.getConnection();
} catch (Exception e ){
e.printStackTrace();
}
But I am not getting the results that i need inserted, after the applet has finished running. I know almost nothing about applets, so any help is much appreciated!!!
Is it possible for me to connect to the db through an applet loaded on a web page?? Both wep application and db are on the same host. What's wrong with the above code???
PS. I hope this is the right place for the post....