Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Applets and SQL

  Asked By: Howard    Date: Jun 23    Category: Java    Views: 581
  

I am rewriting a console application to an applet. Problem comes up
when I try to load the JDBC-ODBC bridge, it dies as soon as it tries
to load the driver, with the following error:

java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)

Here is my DataBase connection class. Any help would be greatly
appreciated.

class DBConn
{
Connection con;

public DBConn(String source,String login,String password)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection
("jdbc:odbc:"+source,login,password);
}
catch(Exception e)
{
System.out.println(e+" DBConn");
}
}

public Connection getCon()
{
return con;
}

public void closeCon()
{
try
{
con.close();
}
catch(Exception e)
{
System.out.println(e+" DBConn.closeCon");
}
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Applets and SQL Or get search suggestion and latest updates.




Tagged: