Applet Database Connectivity

I m trying following code to connect Database within Myapplet

but class.forName is throwing exception?

Any idea to remove this problem?

import java.applet.*;

import java.awt.*;

import java.sql.*;

public class Myapplet extends Applet {

int width, height;

Connection con;

Statement st;

ResultSet rs;

public void init() {

width = getSize().width;

height = getSize().height;

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con = DriverManager.getConnection("jdbc:odbc:abc","","");

st=con.createStatement();

}

catch(Exception e)

{

//out.println("some problem");

}

}

public void paint( Graphics g )

{

}

}

[782 byte] By [Anurag_Tripathia] at [2007-11-26 17:18:34]
# 1
You must first check that driver you are using to connect with DB is placed in your class path.If driver is not found then Class.forName(); throws exception.
Dev@nanoa at 2007-7-8 23:46:34 > top of Java-index,Desktop,Core GUI APIs...
# 2
i have faced same problem , exception was something abt. security ,when i was trying to connect with MS ACcess.....
Anand_Agrawala at 2007-7-8 23:46:34 > top of Java-index,Desktop,Core GUI APIs...
# 3
If you're trying to connect to a datasource located somewhere except your server than your applet should be signed.
beradriana at 2007-7-8 23:46:34 > top of Java-index,Desktop,Core GUI APIs...