Calling Applet !!!
Hi All!!
I am very Beginner in ASP. I called this applet in ASP file it is being run but it is just printing the Button and combobox but data is not fetching from the oracle while it I run it in DOS by:
appletviewer CheckApplet.java
then it is working perfectly. so why not in browser through ASP.
HELP ME PLS.
My ASP Code is :
------------------------
<html>
<Applet code = "CheckApplet.class" height = "300" width = "300">
</Applet>
</html>
------------------------
And my Java Code is:
-----------------------------------
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class CheckApplet extends Applet
{
Connection con;
Statement st;
public void init()
{
Button B1 = new Button("Click on Me");
TextField T1 = new TextField();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("Jdbc:Odbc:OracleScott ", "scott", "tiger");
st = con.createStatement();
ResultSet rs = st.executeQuery("select * from emp");
rs.next();
//System.out.println("Name : " + rs.getString("ENAME"));
T1.setText(rs.getString("ENAME"));
}
catch(Exception Ex)
{
System.out.println("Exception Generated : " + Ex);
}
add(B1);
add(T1);
}
}
-----------------------------------
Thanks in Advance!!!:)
DPK..
__________________
DPK..
|