Hi All,
I want to get values from the database and show it on the applet. I am attaching the code for connecting the database. It is giving Security Exception Error
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import javax.swing.table.TableColumn;
import java.sql.SQLException;
import java.sql.*;
import java.applet.Applet;
public class TablePanel extends Applet {
public void init() {
// setLayout (new BorderLayout());
try
{
Connection con = null;
Statement stmt = null;
Statement stmt1 = null;
ResultSet rs = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = java.sql.DriverManager.getConnection("jdbc
dbc
ubs","sa","sa");
stmt = con.createStatement();
String sQuery = "select * from w_users";
rs = stmt.executeQuery(sQuery);
rs.next();
}
catch(SQLException ex)
{
System.out.println("Error");
}
catch(ClassNotFoundException ex)
{
System.out.println("Class not found");
}
}
}
Pls suggest me how to do this.
Thanks in advance