JDBC through Applet...

We are getting 'AccessControlException' while using JDBC through Applet.
Can anybody suggest the changes to be made in the policy file OR security setting OR security Manager.

The tutorial gives help about it at :
http://java.sun.com/docs/books/tutorial/security1.2/tour1/index.html
hope it will help.

Similar Messages

  • Jdbc connectivity through applet problem   urgent ASAP

    hi ,
    am trying to connect to the oracle database through applet. it gives a classnotfound exception . the same code works for other applications but not through the applet . why ? any idea to get it worked.I need to use this applet in a jsp file . in jsp file it gives an SQLexception as : java.security.AccessControlException:access denied(java.util.PropertyPermission oracle.jserver.version read)
    how do i get it solved . please help me.
    here is the applet code :
    import java.awt.*;
    import javax.swing.*;
    import java.lang.*;
    import java.util.*;
    import java.sql.*;
    public class Dot extends JApplet
        int xinterval,yinterval;
         private String message = "Initializing";
      //  int xexp=-40,yexp=20;
        Vector result = new Vector();
        Vector result1 = new Vector();
         public void init()
         int max = 100;
         int min = -100;
         xinterval = max/10;
         yinterval = min/10;
         try{     
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL","chandu","chandu");
         PreparedStatement ps = con.prepareStatement("select name,expression_level,functional_classification from viewall where subexperiment_id = SRB4delta");
         PreparedStatement ps1 = con.prepareStatement("select name,expression_level,functional_classification from viewall where subexperiment_id = SRB5delta");
        ResultSet rs = ps.executeQuery();
        ResultSet rs1 = ps1.executeQuery();
         while(rs.next()){
              String arr[] = new String [3];
              arr[1]=rs.getString(1);
              arr[2]=rs.getString(2);
            arr[3]=rs.getString(3);
              result.addElement(arr);
    while(rs1.next()){
              String arr[] = new String [3];
              arr[1]=rs.getString(1);
              arr[2]=rs.getString(2);
            arr[3]=rs.getString(3);
              result1.addElement(arr);
         con.close();
         rs1.close();
         rs.close();
    catch (Exception e)
                  setError("SQLException: " + e);
         public void paint (Graphics g)
    if (result == null) {
             g.drawString(message, 5, 50);
             return;
         for(int i = 0 ; i<=10;i++){
              String temp= String.valueOf(xinterval*i);
              String temp1=String.valueOf(xinterval*(10-i));
              g.drawString(temp,500+(50*i),510);
            g.drawString(temp1,480,(50*i));
             temp=String.valueOf(yinterval*i);
              temp1=String.valueOf(yinterval*(10-i));
            g.drawString(temp,480,500+(50*i));
            g.drawString(temp1,(50*i),510);
         g.drawLine(500,0,500,1000);
        g.drawLine(0,500,1000,500);
        Enumeration enum = result.elements();   
        Enumeration enum1 = result1.elements();   
         while (enum.hasMoreElements() & enum1.hasMoreElements()) {
           String arr[] = new String [3];
             String arr1[] = new String [3];
           arr = (String [])enum.nextElement();
          arr1 = (String [])enum1.nextElement();      
         String col = arr[2] ;
         if(col.equals("CC"))
              g.setColor(Color.red);
         else if(col.equals("CF"))
              g.setColor(Color.green);
         else if (col.equals("S"))
              g.setColor(Color.blue);
         else if (col.equals("T"))
              g.setColor(Color.gray);
         else if (col.equals("U"))
              g.setColor(Color.pink);
         else if (col.equals("M"))
             g.setColor(Color.magenta);
         else if (col.equals("E"))
            g.setColor(Color.yellow);
         else
             g.setColor(Color.black);
        int xexp = Integer.parseInt(arr[1]);
         int yexp = Integer.parseInt(arr1[1]);
        g.drawString("test",500,600);
         if(yexp<0 & xexp>0)
          g.fillOval(500+((xexp/10)*50),500-((yexp/10)*50),8,8);
         if(yexp<0 & xexp<0)
                  g.fillOval(500+((xexp/10)*50),500-((yexp/10)*50),8,8);
         if(yexp>0 & xexp>0)
                  g.fillOval(500+((xexp/10)*50),500-((yexp/10)*50),8,8);
         if(yexp>0 & xexp<0){
                  g.fillOval(500+((xexp/10)*50),500-((yexp/10)*50),8,8);
        private synchronized void setError(String mess) {
         result = null;     
         message = mess;     
         repaint();
    }

    In contrast to what many people say in this forum, it is possible to have an unsigned applet access a database. You don't even have to manipulate the client's policy-file. The requirement is that the database is located on the same machine as the applet is downloaded from.There are however other things that can break this possibility. One is the database-driver itself.
    In the case of Oracle we have tried using different versions of the driver. When using version 8.1.7 or 9.0.1 things work nicely, but when switching to version 9.2 it stops working. There is a question on OTN [1]. Let's see what Oracle has to say about it.
    [1] Problem connecting using Oracle JDBC drivers

  • Connectivity of database through applet

    Hi to all,
    I want to how to make the connectivity of database(preferably mySql) to java application through applet....

    Possible answers to a more focused question:
    Make sure the jar file containing the JDBC driver is in your applet's classpath.
    Read the JDBC tutorial.
    Make sure that the network connectivity between your client and the database is working.
    Any of those sound right? No? Want to ask a more specific question?

  • Connecting to database through applet

    hi friends
    I am trying to connect to sql database through applet but I cant.
    in fact it can not connect to database.
    plz any body tell me how can i do this. Thanks

    // class depends on
    //     msbase.jar
    //     mssqlserver.jar
    //     msutil.jar
    // these api's are part of Microsoft SQL Server 2000 Driver for JDBC
    // allso need JNDI file system Service provider: found @ sun http://java.sun.com/products/jndi/#DOWNLOAD12 the JNDI 1.2.X class librarys and
    //          File system provider 1.2 beta 3
    //     fscontext.jar
    //     providerutil.jar
    //      (jndi.jar) provided in java > 1.3*
    // to compile:
    // javac -classpath "C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\j2sdk1.4.2_01\jndi\lib\fscontext.jar;C:\j2sdk1.4.2_01\jndi\lib\jndi.jar;C:\j2sdk1.4.2_01\jndi\lib\providerutil.jar" SQLTest.java
    import javax.sql.*;
    import java.sql.*;
    import javax.naming.*;
    import java.util.Properties;
    public class SQLTest extends Thread {
        String sqlServerUser = "sql login account";
        String sqlServerPWD = "sql password";
        String sqlServerName = "sql machine";
        String sqlServerPort = "1433";
        public SQLTest() {
        public static void main(String[] args) {
            (new SQLTest()).run();
        public void run(){
            Connection conn = null;
            try{
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + sqlServerName + ":"+ sqlServerPort + ";User=" + sqlServerUser + ";Password=" + sqlServerPWD + ";ProgramName=JAVA-jdbc;DatabaseName=Northwind");
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("Getting a connection with drivermanager works fine");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
            if(true){return;}
    // try it with a datasource
            try{
            // Setting the context:
                com.microsoft.jdbcx.sqlserver.SQLServerDataSource sds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
                sds.setServerName(sqlServerName);
                sds.setDatabaseName("Northwind");
                sds.setNetAddress(sqlServerPort);
                Properties p = new Properties();
                p.put(Context.INITIAL_CONTEXT_FACTORY,     "com.sun.jndi.fscontext.RefFSContextFactory");
                Context ctx = new InitialContext(p);
                try{
                    ctx.unbind("jdbc/EmployeeDB");
                }catch(Exception e){
                }finally{
                    ctx.bind("jdbc/EmployeeDB",sds);
                DataSource ds = (DataSource)ctx.lookup("jdbc/EmployeeDB");
                conn = null;
                conn = ds.getConnection(sqlServerUser,sqlServerPWD);
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("works with datasource");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
    }To give an applet special privileges you can specify the prifs in the java.policy file or sign the applet and choose "yes I trust" or "yes I allways trust" when the applet is loaded.
    To give special prifs with the java.policy, it should look like this:
    grant {
    permission java.lang.RuntimePermission "usePolicy"; // prevents the popup from showing for signed applets
    grant codeBase "file:C:/-" {
      permission java.security.AllPermission;
    grant codeBase "http://localhost/-" {
      permission java.security.AllPermission;
    };

  • Thin JDBC through firewall - what ports need to be open?

    We are running Oracle 7.3, and Oracle Web Server on the same
    computer. The firewall is set up to allow connections to that
    computer from anywhere, on ports 80 and 1521.
    Our thin JDBC applet works perfectly from inside the firewall,
    but from outside, I get a time-out error trying to open the JDBC
    connection.
    What else needs to be done get JDBC through? Do other ports need
    to be open on the firewall?
    The JDBC FAQ mentions a "Net8 compliant" or "SQLNet certified"
    firewall - is that relevant to this problem, and if so, what does
    it really mean?
    We are supposed to be operational right now, so many many thanks
    for any help on this!
    - Joe Wielgosz
    null

    Try in the Lion Server Forum?
    Regards,
    Colin R.

  • Problem in printing to LPT1 through applet?

    Hello everyone,
    I am having problem in printing through Applet in LPT1 of remote client machine using "gridDoubleClicked" method of customized "GridPanel" which is third party component. The class structure is given below:
    public class GridPanel extends Panel implements GridPanelInterface, AdjustmentListener, KeyListener, FocusListener, Serializable
    }I am using above class to populate data in table and perform "double click" action. I am using JDK 1.5 and a self signed jar to access from remote machines through applet.The code, I am using is given below:
    public class testApplet extends Applet {
        printToLPT1 lpanel =new printToLPT1();
        public void init() {
          this.setLayout(new BorderLayout());
          this.add(lpanel, BorderLayout.CENTER);
          this.setSize(380, 250);
    public class printToLPT1 extends Frame{
    GridPanel grid;
    public printToLPT1() throws Exception {
    grid.addGridListener(new GridAdapter() {
                public void gridDoubleClicked(GridEvent ge) {               
                    testPrint();
    public static void testPrint() throws Exception {
            try {
                BufferedOutputStream pos = new BufferedOutputStream(new FileOutputStream("LPT1"));
                String str = "\n\n\n\n\n\n\n\n\n\n\n";
                pos.write(str.getBytes());
                pos.flush();
                pos.close();
            } catch (Exception fnfe) {
                throw new Exception("PRINTER SETUP IS NOT PROPER");
    }For applet, I have used following script in login.html:
    <APPLET
         height="200px"
         archive="testprinter.jar,jbcl.jar,grid.jar,plugin.jar" 
         width="390px"
         align="top"
         code="test.testApplet.class"
         name="Testing"
        ALT="<P>This applet requires Java to be enabled!  Check the browser options or see your SysAdmin." MAYSCRIPT>
        <P>This page requires Java!  Get it free from <A HREF='http://www.java.com/'>www.java.com</A>.</P>
    </APPLET>
    ------------------- If signed jar file of application is run using command line in client machine then "double clicked" of GridPanel method works fine and send signal to printer at LPT1 port but when same application is called using applet and accessed from remote machine with printer in LPT1 port, in that time also "double clicked" of GridPanel method works fine but printer could not be found and Exception is thrown java.lang.Exception:"PRINTER SETUP IS NOT PROPER" . Why is this happening? Can anyone suggest me the solution for this problem?
    Thanks in advance.
    -Ritesh
    Edited by: ritesh163 on Apr 15, 2010 2:56 PM

    The SSCCE for this problem is given below:
    //Applet class
    package test;
    import java.awt.BorderLayout;
    import javax.swing.JApplet;
    public class testApplet extends JApplet {
        testPrint lpanel =new testPrint();
        public void init() {
          this.setLayout(new BorderLayout());
          this.add(lpanel, BorderLayout.CENTER);    
          this.setSize(380, 250);    
    // Printing class...
    package test;
    import com.borland.jbcl.layout.XYConstraints;
    import java.awt.Color;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.io.BufferedOutputStream;
    import java.io.FileOutputStream;
    import wdn.grid.GridAdapter;
    import wdn.grid.GridData;
    import wdn.grid.GridEvent;
    import wdn.grid.GridPanel;
    public class testPrint extends javax.swing.JFrame {
        // Variables declaration - do not modify                    
        private javax.swing.JButton btnPrint;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration     
        GridPanel grid;
        GridData gdata;
        String[] gridCols = {
            "Receipt No", "Name"};
        public testPrint() {
            grid = new GridPanel(0, 8);
            gdata = new GridData(0, 8);
            grid.setRowHeaderWidth(0);
            grid.setGridData(gdata);
            grid.setMultipleSelection(false);
            grid.setColWidths("100,60");
            grid.setColHeaders(gridCols);
            setGridProperties(grid);
            grid.setColSelection(false);
            this.setVisible(true);
            grid.addGridListener(new GridAdapter() {
                public void gridDoubleClicked(GridEvent ge) {
                   //This event works fine...
                    System.out.println("Press Re-Print button...");
                    try{
            stringToPrinter("testing by grid \n\n\n\n\n\n\n\n\n\n\n\n\n");
            }catch(Exception ex){
                ex.printStackTrace();
                public void gridCellsClicked(GridEvent ge) {
                    btnPrint.setEnabled(true);
            initComponents();
            jPanel1.add(grid, new XYConstraints(52, 60, 100, 150));
            grid.deleteRows(1, grid.getNumRows());
            grid.insertRow(1);
                        grid.setCellText(1, 1, "12134", false);
                        grid.setCellText(2, 1, "test" + "", false);
                        grid.repaintGrid();
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            btnPrint = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            btnPrint.setText("Print");
            btnPrint.setToolTipText("to Print");
            btnPrint.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btnPrintActionPerformed(evt);
            org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel1Layout.createSequentialGroup()
                    .add(36, 36, 36)
                    .add(btnPrint)
                    .addContainerGap(287, Short.MAX_VALUE))
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(198, Short.MAX_VALUE)
                    .add(btnPrint)
                    .add(57, 57, 57))
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            pack();
        }// </editor-fold>                       
        private void btnPrintActionPerformed(java.awt.event.ActionEvent evt) {                                        
            try{
            stringToPrinter("testing \n\n\n\n\n\n\n\n\n\n\n\n\n");
            }catch(Exception ex){
                ex.printStackTrace();
        public static void setGridProperties(GridPanel grid) {
            grid.setRowHeaderWidth(0);
            grid.setAutoResizeColumns(true);
            grid.setRowNumbers(true);
            grid.setCellSelection(false);
            grid.setRowSelection(true);
            grid.setHighlightColor(Color.blue);
            grid.setHighlightTextColor(Color.white);
            grid.setAutoResizeRows(true);
            grid.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                public void keyPressed(KeyEvent e) {
                    if (e.getKeyChar() == KeyEvent.VK_SPACE) {
                public void keyReleased(KeyEvent e) {
        public static void stringToPrinter(String str) throws Exception {
            try {
                System.out.println("inside stringToPrinter...");
                BufferedOutputStream pos = new BufferedOutputStream(new FileOutputStream("LPT1"));
                System.out.println("inside stringToPrinter...1-pos::"+pos);
                pos.write(str.getBytes());
                pos.flush();
                pos.close();
            } catch (Exception fnfe) {
                throw new Exception("PRINTER SETUP IS NOT PROPER");
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new testPrint().setVisible(true);
    }

  • Use of jdbc in applets

    hi ,
    i am priya i am a learner of java and i am facing some of the problems in using jdbc with applets
    i am using ms-access as database and it shows some error messages when i compile the code such as
    access denied due to applet security etc
    So, please help me in this way so that i can use applets with jdbc
    thanx,

    I second that. Using JFrame instead of JApplet is easy once you've seen an example:
    http://java.sun.com/docs/books/tutorial/uiswing/learn/example1.html
    When learning Swing, I can think of only disadvantages to using JApplet over
    JFrame. Why do textbooks use applets? Old habits die hard and they
    are out-of-date in their view of Java.
    Side comment: when learning a new topic, like JDBC, I would
    strongly advice you to write the simplest possible code at first.
    In other words, skip the Swing and write simple console apps:
    1. select and dump the contents of a table.
    2. gradually do more sophisticated selects...
    3. insert a record into a table using some fixed values.
    3. delete records from a table.
    4. update records using some fixed values.
    Once you are comfortable doing CRUD, and used PreparedStatement!,
    then add a GUI. And if your code is well-written, the GUI and the back-end
    are separate enough anyway, that you can write and test them apart.

  • How to execute System command through Applet

    Hi all,
    How can I execute a System command through Applet.
    I have written a code Runtime.exec("ls") in my applet but it gives me
    this execption even if I certify the applet ->
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
         at java.security.AccessController.checkPermission(AccessController.java:399)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
         at java.lang.SecurityManager.checkExec(SecurityManager.java:802)
         at java.lang.Runtime.exec(Runtime.java:548)
         at java.lang.Runtime.exec(Runtime.java:418)
         at java.lang.Runtime.exec(Runtime.java:361)
         at java.lang.Runtime.exec(Runtime.java:325)
         at Test.init(Test.java:24)
         at sun.applet.AppletPanel.run(AppletPanel.java:344)
         at sun.plugin.navig.motif.MotifAppletViewer.maf_run(MotifAppletViewer.java:123)
         at sun.plugin.navig.motif.MotifAppletViewer.run(MotifAppletViewer.java:119)
         at java.lang.Thread.run(Thread.java:484)
    Thanks,
    Manoj.

    There should be a lesson about this somewhere.
    When you visit a web page, does it ask you if you want to have an applet loaded?
    Answer: No
    So, if you visit a page, and an applet is silently loaded which can then execute commands on your computer, is this good?
    Answer: No
    So why do you want to do this?
    Is it good for anyone?
    I mean, if I want to do "ls", can't I just open a command line? Do I need an applet to do it for me?
    Either you have devious desires or your hacking together something that probably shouldn't be.
    If you want to learn start here:
    http://java.sun.com/docs/books/tutorial/security1.2/index.html
    With the article entitled:
    Quick Tour of Controlling Applets
    Ian

  • Database Connection through Applet

    Hello All,
    I want to connect to Access Database through Applet. But I am getting access denied error. How to allow an Applet to connect to the database ?.
    Waiting for reply.
    Thanks and regards,
    Sachin

    I believe it's possible to change the security policy for the java plugin that runs applets, (though I haven't found an appropriate policy file). However, there seems little point in writing an applet that requires that. The whole point of applets is that anyone can run your applets over the net without any special installation. If whoever is going to run your applet has to muck about with security policy files, they'd be a lot better off just running a stand-alone GUI program.
    Even if you signed the applet there would still be the problems associated with having the access file in the right place on the client machine.
    In short you're falling between two stools. Either make the thing a standalone Swing program and install it alongside the database it accesses or do the database access in a web server environment and have the client side obtain the data from the database through http access.

  • Is it possible to know the size of EEPROM that available through Applet?

    Hi Friends..
    I want to know is it possible to know the available EEPROM size through Applet..
    I mean i want to create an Applet that checks the size of EEPROM that still available..
    Thanks in advance

    http://www.cs.ru.nl/~woj/javacardapi221/javacard/framework/JCSystem.html#getAvailableMemory%28byte%29
    but no more than 32K are reported.
    regards
    sebastien

  • JDBC:ODBC through Applet?!?

    Hi folks!
    Can anyone please tell me exactly what i need to do on the clients computer befor i can implement a JDBC:ODBC-bridge for SQL Server 6.5 connectivity?
    This program, unfortunately, must be an Applet.
    The Client environment looks like this:
    -Windows 98
    -Internet Explorer 5
    -JDK 1.3
    What about the Jdbc drivers where do i put them?
    And the policy-files, do i really need to change the security.policy on all client-computers?
    I know there is a lot of tutorials and threds like this one but
    none has got the suitable answer for my situation.
    Many thanks in advance!
    Regards
    Robert H�kansson

    Yes it is possible to connect applet to the databse. For this you need to use the database specific drivers to make the database connection along with the certificate from any certificate authority like verisign.com or some other certificate authority. If user accepts the certificate , he will be able use the applet as a normal applet otherwise applet will not load on the client.

  • JDBC in applet URGENT

    Hi,
    I have created an application by using JDBC,now i would like to convert this application into applet and put it online. So i register a domain name, create a jar file for this application and use browser to load it. But so far from what i know, online features have to be done by using JSP,so is it possible to use JDBC to connect to database and do functions online?If not,it means i have to replace JDBC by JSP?
    Thanks for any help.

    Hi
    Please make note of some points:
    1. You can very well create your application as an Applet and then connect to a database through JDBC.
    2. If you think you can make use of the server resources properly you can go ahead with your applet. Otherwise you can switch to JSP, but you may not get any useful resources like Swing, JFC and other stuff through plain jsp, for all these you need an applet as a container for these.
    The problems you are facing is because applets are not secure, you need to sign your applet so as to make use of the system resources available and the applet to interact with your client machines. when you create your jar file you have to sign it using the jarsigner bound to a security certificate installed. Through java you can create your own self signed certificate with the keytool option available in your jdk. Then you have to use the HTMLConverter and pass the HTML file containing the applet tags pointing to your class file, this will convert the applet into browser readable format. Then you are all set, open the applet through your browser and <b>BINGO</b> you are up and moving.
    If you have any more doubts please feel free to ask me.
    Thanks
    Swaraj

  • Policies, JDBC and applets

    I have looked all over the WWW for info on this and have found loads of questions but not one clear cut answer. It's amazing the number of "OK, thanks, I got it working" without saying how. Here is my problem. I have a JDBC applet, running on IE. If I run it locally it works like a champ. If I run it through "localhost:xxx.html I get that infamous "Unable to connect to MySQL on localhost:3306, are you sure it's running..Java.security.accesscontrol exception. One problem mentioned setting a policy..didn't mention which one though. So I set socket connection priv on localhost:3306 as that was explicitly mentioned in the exception. Seemed like a good idea. It was but still did not solve the problem. So what I think would be really swell is if in one place there was a really good answer on how to set up an applet using JDBC under IE to work with respect to the security manager. Could someone please help?
    Thanks in Advance,
    Walt

    Hi,
    Let's first c an example of the intended functions of the two methods.
    We have an HTML-type document, "document.html" at:
    host_name/some_directory/document.html
    and we have our applet, "OurApplet.class" at:
    host_name/some_directory/applets/OurApplet.class
    In the "document.html", we have embedded "OurApplet.class" inside. Then getDocumentBase().toString() should supposedly be:
    host_name/some_directory/document.html
    and getCodeBase().toString() should supposedly be:
    host_name/some_directory/applets/OurApplet.class
    If the directories containing the HTML document and the applet were the same, both methods would give the same thing; if they r not, it'd be like the above.
    Ok, the above is the way they'r intended to be. According to the bug ChuckBing has shown us (actually the methods r under the class java.applet.Applet instead of under the package java.applet), the two methods however produce what their counterpart friends is supposed to produce. So if your version of SDK/JRE produces the bugged version of the output, u can replace the method with its counterpart friend. However, keep in mind of the target JRE the applet will be run on and the possibility of more than one potential audience JREs.

  • Bypassing JDBC through Firewall

    I build an applet that connect to Oracle 8i through JDBC.
    However, my web server has firewall in it (Tunnel Agent Network)
    and the oracle database also located in the same web server. My
    applet can't connect to the database because of the firewall.
    Therefore, I was wondering if there is a way, trick, or tips to
    bypass the firewall? If not, what's my alternative?
    Thanks
    -ed-
    null

    Here are a couple of my thoughts.
    When you say GUI I'm making the assumption that you are talking about a single tier / rich client application written using Swing.
    It is impractical to develop a single tier GUI application with JDBC to connect to a public database server on the Internet. The architecture is simply to difficult to implement because of the wide variety of security mechanisms in place on the Internet. Worse yet, attempting to make it work will open up security holes on the users computer.
    A more common approach would be to use a web server / application server to manage the database access (sometimes called 2 tier or multi-tier). This would of course require you to write a web based interface for user interaction.
    If you require a single tier GUI application with JDBC to connect to a private database server through (not on) the Internet that can often be done using a Virtual Private Network (VPN).
    There might be other options (there are actually) but it depends on what your are hoping to accomplish. The single sentence from your post probably isn't enough to discuss a full blown architecture.

  • Has Anyone tried to use DDE through Applets

    I would like to update a client side opened Excel file via the web using DDE ( Windows protocol used to cut and paste between apps ) and an applet.
    I guess that the level of security of the sand-box will limit the interaction with the excel application unless the applet jar is signed and certified.
    Has anyone tried to develop such application ?
    I didnt go through all the DDE technology yet and I am just wondering if there are some great difficulties to overcome.
    Any "difficult to find" hints are welcome
    Thanks

    Thanks for the hint. A good one as I did not know this link.

Maybe you are looking for