Applets in IE anddatabase connection

hello all,
I have two problems regarding applets
1).I have an applet that is trying to make a connection to a different host.But while it does it gives me a security exception saying access denied.
2).I have compiled my applet as
javac -target 1.1 JVoucher1.java
because i am using J2re1.4.0 .It compiles but when i try to run from the browser by disabling J2re1.4.0 in the browser properties it fails to come up.It comes otherwsie if i enable j2re1.4.0
Suggest and help.
regards,
nikhil

bumpert
Thanks.Are you sure that i have to get it signed. There is no other solution you mean.
About he second problem i got it working using the Object tag that looks like this:
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
HEIGHT="610" WIDTH="975" ALIGN="bottom" ARCHIVE="classes12.jar,classes111.jar" codebase="http://apps1.cbfamilies.org/test/j2re-1_4_0-win.exe#Version=1,4,0,0" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="code" VALUE="JVoucher1.class">
<param name=workerTextField value= nikhil >
No JDK 1.4 support for APPLET!!
</OBJECT>
I am installing Java plugin to be compatibale with 1.2 .This works fine.
I thought we can also do through javac -target 1.1 JVoucher1.java which
when compiled alllows the applet class to be compatible with the 1.1 of Microsoft VMin IE.
Any suggection from the forum or Sun guys.
nikhil

Similar Messages

  • Network Manager Applet Cannot Edit Options/Connections As Normal User

    Today I installed Network Manager, and Network Manager Applet in XFCE as a normal user. I followed the instructions on the Arch Network Manager Wiki to the best of my knowlage. The NM-Applet connects to my ethernet, and everything is fine. Untill that is, when I right click the NM Applet.
    Once right clicked as a normal user, 'Enable Networking', and 'Enable Wireless' are greyed out and unselectable. Also, when I right click the applet and select 'Edit Connections' 90% of the clickable options are greyed out, including the options to 'Edit' or 'Delete' connections. The only clickable option not greyed out is 'Add' button.
    Clicking Add brings up the 'Add New Connection Window', but again everything is greyed out. 'Available To All Users' is checked, but is greyed out also. But, starting XFCE as root, allows me to use the NM Applet with no restrictions, AKA none of the greyed out options. Everything works fine.This is my second day using Arch, so I am not sure where to go now.
    It also may be of help ito say I haven't gotten a display manager, such as lightdm or gdm.
    My guess is that root is listed under a group the 'jesse' isn't. Or maybe it has something to do with PolicyKit. I'm not sure. If someone could give me a set of clear instructions on how to fix this annoyance, it would be greatly appreciated. Thank You.
    My Current Normal User Groups wrote: disk lp wheel uucp games network video audio optical storage scanner power users
    My /etc/hosts file wrote:
    # /etc/hosts: static lookup table for host names
    #<ip-address>   <hostname.domain.org>           <hostname>
    127.0.0.1              localhost.localdomain localhost jesse
    ::1                         localhost.localdomain localhost jesse
    # End of file
    My /etc/rc.conf wrote:
    # /etc/rc.conf - configuration file for initscripts
    # Most of rc.conf has been replaced by various other configuration
    # files. See archlinux(7) for details.
    # For more details on rc.conf see rc.conf(5).
    DAEMONS=(alsa dbus syslog-ng crond ifplugd networkmanager bluetooth avahi-daemon acahi-dnsconfd avahi-dnsconfd fa$
    # Storage
    # USEDMRAID="no"
    # USELVM="no"
    # Network
    # interface=eth0
    # address=
    # netmask=
    # gateway=
    My /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla wrote:Identity=unix-group:network
    Action=org.freedesktop.NetworkManager.*
    ResultAny=yes
    ResultInactive=no
    ResultActive=yes
    Last edited by TriforceLZG (2012-09-02 13:43:23)

    I found the solution, I had to install a Display Manager. Now everything is fine.

  • Error when applet is trying to connect to WLS server

    Hello everyone,
    I'm currently having problems with applets and WebLogic. Though I know, applets are not the most appreciated way to do things with weblogic (or even in general), there are no real alternatives for us.
    We have a larger application consisting of several servlets, already integrated into WLS and using the data sources.
    Now we want to create a small piece of applet that uses WLS to get data from the same JDBC data sources to display and navigate inside charts. These might even be updated on a regular basis while the applet is running.
    So, there are two questions:
    First, is it possible for the applet to be available on the server and connect to WLS by creating an initial context? I'm currently trying and i get an "java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)". See the attached code below to see the connection example.
    Second, if i can connect to the WLS, will this also be possible when the WLS is not localhost anymore, but another server? To clarify, an example:
    Can an applet that is running inside a WLS at "http://theotherserver.net:7001/myapp/MyApplet.class" connect to the WLS at "theotherserver.net"?
    I'd be glad if anyone could help me with that. The code I'm currently using (inside the init() function of the applet), is the following:
    public void init() {
         Context ctx = null;
         Hashtable<String, String> ht = new Hashtable<String, String>();
         ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
         ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
         try {
              ctx = new InitialContext(ht);
         // Use the context in your program
              System.out.println("context success");
         } catch (NamingException e) {
         System.out.println("NamingException"); // a failure occurred
         e.printStackTrace();
         } catch (AccessControlException e) {
              System.out.println("security control exception when authing"); // a failure occurred
              e.printStackTrace();
         } catch (Exception e) {
              System.out.println("other exception"); // a failure occurred
              e.printStackTrace();
         } finally {
              System.out.println("finally");
              try {
                   ctx.close();
                   System.out.println("close");
              } catch (Exception e) {
                   System.out.println("close exception"); // a failure occurred
    When the applet is run, whatever I do in start() etc get's done (for example drawing charts with jfreechart), but the java console prints the following as a result of the failed connection to WLS:
    security control exception when authing
    java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.Thread.setContextClassLoader(Unknown Source)
         at weblogic.corba.j2ee.naming.ORBHelper.createORB(ORBHelper.java:426)
         at weblogic.corba.j2ee.naming.ORBHelper.getORBReferenceWithRetry(ORBHelper.java:571)
         at weblogic.corba.j2ee.naming.ORBHelper.getORBReference(ORBHelper.java:547)
         at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:85)
         at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:31)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.igrafx.charter.program.CharterApplet.init(CharterApplet.java:70)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    finally
    close exception
    Edited by: user10921034 on 11.11.2009 09:46

    I have solved the above problem now. The problem was, that I only signed my own jar, but not the wlclient.jar, which also needs the rights to instantiate classes.
    This also solved my second question. Yet, there is another thing, now that I am trying to use JNDI to access a JDBC shared datasource from weblogic.
    The data source is accessible and working (tested from servlets). Now I'm trying to create a connection with the following code, but it does not get past the first lookup:
    try {
    DataSource ds = (DataSource) this.appletContext.lookup("ReportCentral");
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    The thrown exception:
    java.lang.NoClassDefFoundError: weblogic/jdbc/common/internal/RemoteDataSource
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$000(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
         at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
         at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
         at com.sun.corba.se.impl.util.JDKBridge.loadClassM(Unknown Source)
         at com.sun.corba.se.impl.util.JDKBridge.loadClass(Unknown Source)
         at com.sun.corba.se.impl.javax.rmi.CORBA.Util.loadClass(Unknown Source)
         at javax.rmi.CORBA.Util.loadClass(Unknown Source)
         at com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl.createStubFactory(Unknown Source)
         at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_Object(Unknown Source)
         at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_Object(Unknown Source)
         at com.sun.corba.se.impl.encoding.CDRInputStream.read_Object(Unknown Source)
         at com.sun.corba.se.impl.corba.TCUtility.unmarshalIn(Unknown Source)
         at com.sun.corba.se.impl.corba.AnyImpl.read_value(Unknown Source)
         at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_any(Unknown Source)
         at com.sun.corba.se.impl.encoding.CDRInputStream.read_any(Unknown Source)
         at weblogic.corba.cos.naming._NamingContextAnyStub.resolve_any(_NamingContextAnyStub.java:81)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:208)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:168)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at com.igrafx.charter.program.CharterApplet.start(CharterApplet.java:178)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I cannot find the mentioned class, to include it in my jar, neither am I sure that this is the best way to get a connection to the database this way.
    In the applet, it is NOT possible to create the connection by hand, as the user/password are only available to weblogic, but not the overlying J2EE applications.
    If i do that on my local system, nevertheless, it works:
    OracleDataSource ds = new OracleDataSource();
    ds.setURL("jdbc:oracle:thin:...@localhost:1521:XE");
    conn = ds.getConnection();
    This creates a valid connection.
    So, the major question is: How can I access the connection pool of Weblogic through an applet?

  • Applet security problems while connecting with database

    i hav problem in the japplet connecting with sql database
    it gives security access denied error while running program as my driver is jdbc:odbc:bridge driver
    so for resolving this error how can i turn off security of applet and also which security permission to be change?
    plz reply

    baftos wrote:
    Maybe I should question the need to access a local database on the client PC.
    But anyway, the normal way to obtain security clearance is to use a signed applet.
    Another possibility is to grant the applet all permissions by modifying the security policy file of each client to grant your applet 'all permissions'. Note that in this case you must have access to each and every client PC or ask them to do so before running the applet.Database access at client's machine is ridiculous. I doubt this is what OP wants.
    @OP: request you to post the original security issue and the environment details.
    Thanks,
    Mrityunjoy

  • Problems embedding in HTML an Applet that uses jdbc connection

    Dear Everyone,
    I'm having some problems deploying an applet that loads image paths from a mysql database. I manage to run the applet in appletviewer through netbeans but can't get to run it embedded in HTML code. The error I get from the java console is:
    load: class imagedisplay/MainApplet.class not found.
    java.lang.ClassNotFoundException: imagedisplay.MainApplet.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: E:\My Documents\NetBeansProjects\imagedisplay\src\imagedisplay\MainApplet\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: imagedisplay.MainApplet.class...where MainApplet.class is the applet class file. I surely don't know what class.class is but I suspect that it might be related to the mysql jdbc driver as I'm totally clueless about where to put it.
    In all I have MainApplet.class (applet) and DoubleBufferApplet.class (applet related), Data.class and ImagePaths.class (to load data from the database) and the mysql jdbc driver jar file. DoubleBufferApplet, Data and ImagePaths are in a package called imagedisplay.
    The HTML is as follows
    <HTML>
    <HEAD>
       <TITLE>Applet HTML Page</TITLE>
    </HEAD>
    <BODY>
      <applet code="MainApplet.class" width="500" height="140">
      </applet>
    </BODY>
    </HTML>Help is much appreciated.
    Regards,
    William.

    Hello Everyone,
    I sorted it out by a series of changes to the file structure, packages and HTML code. I still can't get it to work, but I'll start another thread for that
    Regards,
    William.

  • Applet problem of databse connectivity on different databse server

    Hello Friends
    I am working on chat application using applet.
    But simple applet throw exception for different database server than application server.
    So how can solve this problem ?
    Is Signed Applet a solution ?
    If yes how to develop signed applet ?

    Basically it's not a good idea for applets to try and talk to databases etc. directly. Your applet talks to the sever via http and the server takes care of any database activities etc..
    For a start, your database shouldn't be visible through your firewall, and it's likely, even if it was, the user's site's firewall would block it anyway.
    If it could get the connection your database would be wide open to hacking.
    In principal you could enable a connection by signing the applet, or by modifying the client policy file but it's not the right way to go.
    And if this is just a local application on a controlled set of machines then what's the point in using an applet, when a GUI program would be more flexible and powerful?

  • How to do Applet/Servlet permanent interactive connection

    Hi, I'm modifying an Instant Messaging Application originally implemented under the Applet client/standalone-server scheme that I'm implementing now under the Applet/Servlet scheme using HTTP Tunneling with Object Serialization. But this yet don't work correctly because the connection's flows are closed ever after a Servlet's response to a client request (in this moment are close the connection's flows). I'm using flows of type ObjectInputStream and ObjectOutputStream using Object Serialization with HTTP Tunneling.
    this is part of the connection code in the servlet side:
    public void doGet (HttpServletRequest request, HttpServletResponse response) throws
    ServletException, IOException{
    doPost( request, response);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws
    ServletException, IOException{
    is = new ObjectInputStream(
    new BufferedInputStream(request.getInputStream()));
    try{  
    response.setStatus(HttpServletResponse.SC_OK);
    out = new ObjectOutputStream (
    new BufferedOutputStream (response.getOutputStream ()));
    out.writeObject("OK");
    out.flush();
    // Send the input and output flows to the Thread the Handle the client Connection
    newUser(is, out);
    } catch(Exception ex){
    System.err.println("Exc1: "+ex.toString());
    ex.printStackTrace();
    Run Method to read client request:
    public void run() {
    SocketData sd;
    while ((sd = readObject()) != null) {                               
    sd.performAction(this);
    close();
    After a servlet response in the readObject() method the input flow is closed in the reader request of clients and the connection between the applet (client) and servlet is lost.
    How to can implement a smarter HTTP Tunneling with permanent interactive connection beetween the Applet and Servlet such as in the Applet /server Standalone connection using TCP/IP Socket connection.
    Is possible the use of TCP/IP Sockets in the implementation of HTTP Tunneling with Object Serialization in the Applet/Servlet permanent interactive communication scheme?
    some links or code samples?
    Please show me the ligth.
    Thanks greatly a smarter help.

    I'm not sure that I fully understand your problem, but HTTP is a stateless protocol. That means request-response pairs are completely separated from each other.
    You should ask yourself if you really need to use HTTP and a servlet or if a raw TCP/IP communication would be a better approach to your problem.

  • Chat Applet locks up when connected to a server

    Hey, I am making a chat applet to reach out to IRC like servers. The problem I'm having is when it connects the program locks up till the server disconnect, then it prints the spool into my JTextArea.
    Now, and more bazaar, is that I cannot find a single instructor on the grounds of my tech school who can help me with networking java when 4 people teach in the damn format. Naturally, I'm very frustrated. Any help would be appreciated.

    The full code is at: [http://pastebin.com/m49fe14be|pastebin.com/m49fe14be]
    Naturally I'll be changing this again at least once when I figure out how to play this out.
    Where I'm having problems is: #
            public void connectOut(){
                    try{
                            connectionAddr = InetAddress.getByName(server);
                            connect = new Socket(server, port);
                            initiateReadWrite();
                            //threadRun();
                            //listener = new Thread();
                            //listener.start();
                            //while(listener.isAlive()){
                            readFromServer();
                            connect.setKeepAlive(true);
                    catch(Exception e){
                            exceptioner(e);
            }Or
            public synchronized void readFromServer(){
                    try{
                            String readin;
                            while((readin = in.readLine()) != null){
                                    scrolledText.append(readin + "\n");
                    catch(Exception e){
                            exceptioner(e);
                    }I'm utterly lost and cannot find anyone to help me at my technical college. Four instructors and not a one understands threading.

  • Urgent: how to run applet which connected to the servlet?

    hi frends:
    i have written an applet on the server side and it supposed to pass parameters to my servlet and retrieve some info from the servlet.
    i put both applet and servlet under tomcat../WEB-INF/classes. but when i run the applet from the web browser, there is no response from the servlet.
    could anyone help me to solve this problem?
    one more thing is i know that applet is able to connect to servlet, but how about java application? is it able to do so? if yes, is it also using URLconnection as applet? and how to run it?
    i will be very appreciate if anyone can help me... thanx a million.

    You can connect to the servlet from an application.There's a URL class in java.net that has an openConnection method. Then cast the return to an HttpURLConnection and use setMethod to set up as a post request.This may be the default if you call setDoOutput(true) on the URLConnection. Then you'll need to get an OutputStream and write properly formatted form POST data to it. It's also possible to encode your data on the URL, even when using the POST method, and this may be easier when doing it programmatically from an application. To send a get request you can append the name-value pair at the end of the url.

  • Problem in connect database using applet

    hi
    please
    i want open database in page html with use Applet
    i use this code but database not work in the my page
    if this code have problem
    please correct this code to open database in page html
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(
    "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
    sta = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    res = sta.executeQuery("select * from aha");
    this is my code
    package orcle;
    import java.sql.*;
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    <applet code="test.class" width=200 height=200>
    </applet>
    public class Applora extends Applet implements ActionListener
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    String str=null;
    TextArea ta;
    public void init()
    ta= new TextArea(10,30);
    add(ta);
    Button b1 = new Button(">>");
    add(b1);
    b1.addActionListener(this);
    ta.setText("Initialization...\n");
    public void start() {java.applet.AudioClip a=  Applet.newAudioClip(Applora.class.getResource("a.mid"));
       a.play();
    public void actionPerformed(ActionEvent ae)
    ta.appendText("Inside actionPerformed\n");
    try
    ta.appendText("Inside try block\n");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    ta.appendText("Class loaded\n");
    /********** upto this point it works fine **************/
    con=DriverManager.getConnection("jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
    ta.appendText("Connection created\n");
    stmt=con.createStatement();
    ta.appendText("Statement created\n");
    rs=stmt.executeQuery("select * from aha");
    ta.appendText("Resultset created\n");
    while(rs.next())
    str=str+rs.getString(2)+" "+"\n";
    //str=str+rs.getString(2)+" "+"\n";
    ta.appendText(str);
    con.close();
    stmt.close();
    rs.close();
    }catch(ClassNotFoundException cnfe){System.out.println("Class Not found "+cnfe.getMessage());}
    catch(SQLException sqle){System.out.println("SQL Exception "+sqle.getMessage());ta.setText(sqle.getMessage());}
    catch(Exception e){ta.setText(e.getMessage());e.getMessage();}
    }

    i want access to database in page html with use AppletFirst of all, that doesn't make any sence, if it's a single user application make it a java
    application.
    If it's a multu user application make it a client server where the web server connects to
    the database when the client requests a connection.
    When the applet connects to the database any client running the applet needs a
    connection to your database server, the client needs the jdbc drivers and the client's
    jre needs to find them (set classpath with runtime parameters or set the classes in
    javadir lib). After that the client needs to change thiere java.policy or you need to sign
    the applet.
    Needless to say that's a lot of trouble. And if you go through all that trouble the client
    can de-compile your applet and see the connection to the database server and the
    server name. Now the client can destroy your database or worse see date it is not
    supposed to see.
    Since you are a brainless ... who needed to post this question 6 times did not respond to any of my post in your other threads I can just say good luck with your problem.

  • Need help connecting to a database with an applet

    I am making a Java game that runs in an applet and needs to connect to a Java DB database. I created the database and table in NetBeans and now I have no idea how to connect this applet to the database. I tried using a DataSource and an InitialContext and I got a NoInitialContextException. Any help would be appreciated thanks.

    Already made the InitialContext. This is the code I used in the applet:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("jdbc:derby://localhost:1527/GameDatabase");
    Connection con = ds.getConnection();
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM Scenery");

  • Database connection an applet

    Hi, I want to do an applet where I can connect to a SQL server via an ODBC. The whole conencting to the database works fine with an application, but access is denied when I use an applet ( ie. I have a separated class that do the databases connections and it failed when I use an applet).
    Somebody told me that I have to create a java.policy file for users and signed the applet with .jar. but I'm not familiar with either signing a jar(I'm not familiar with the .jar at all) and I'm not familiar either with the java.policy file. Can anyone explain this to me plz?

    signed the applet with .jar. but I'm not familiar with either signing a jar(I'm not familiar with the .jar at all)So...., check out the link shown below.
    http://developer.java.sun.com/developer/qow/archive/167/index.jsp
    ;o)
    V.V.
    PS: remember me?

  • Error connecting applet with oracle database

    hi all,
    here i m running the following code .
    it executes the following query "Select * from emp";
    the number in the text filed decides the column number to be displayed.
    import java.awt.*;
    import java.applet.*;
    import java.sql.*;
    /*<applet code=project.class width=300 height=200>
    </applet>*/
    public class project extends Applet
    Statement stmt=null;
    Connection conn = null;
    TextField t1;
    public void init()
    t1 = new TextField(2);
    add(t1);
    t1.setText("0");
    public void paint(Graphics g)
    int x=0,y=0,z=0;
    String s1,s2,s;
    try{
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    catch(Exception e)
    try{
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@anant:1521:student", "scott", "tiger");
    stmt = conn.createStatement();
    catch(Exception e)
    s1 = t1.getText();
    x = Integer.parseInt(s1);
    try{
    ResultSet rset = stmt.executeQuery("select * from emp");
    while (rset.next())
    s2 = (rset.getString(x));
    g.drawString(s2,100,100);
    stmt.close();
    catch(Exception e){}
    public boolean action(Event event,Object obj)
    repaint();
    return true;
    i m getting following error.
    Exception in thread "AWT-EventQueue-1" java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    at project.paint(project.java:23)
    at java.awt.Container.update(Container.java:1730)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
    at sun.awt.RepaintArea.paint(RepaintArea.java:216)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
    at java.awt.Component.dispatchEventImpl(Component.java:4031)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    this error comes when i run every jdbc applet.
    can anyone suggest any solution.

    Mintu,
    You said:
    i do have to access to jdbc driversNo, you don't. Otherwise you wouldn't be getting that error message.
    Good Luck,
    Avi.

  • How to run an applet with JDBC connectivity on a web browser

    I've created an Applet in Java with SQL connectivity...i.e. it retrieves certain data from a table in SQL and puts in the TextField.....
    Now, the problem is that this Applet works in NETBEANS....but fails to work when I use a web-browser..or the "appletviewer" command....
    It says that it doesn't have permission to access local files....On Research, i've found that it is somethin' related to the concept of "Signed Applets", "Permissions" & "Security Policies" in java which doesn't allow any applet (without Certificate) to access Local Files.....
    Can Somebody please tell how to overcome this problem.....?

    I'm going to be blunt with you. You are most likely going to have to redesign your application from scratch. And if it turns out you don't have to then you should anyway because it's a bad idea and fraught with peril.
    Anyway here the major touchpoints on this discussion. You can be the judge of how these various points apply to you.
    - Applets are restricted. - Yes Applets have a number of security restrictions on what they can or cannot do. This is designed to protect users from malicious applets. By signing your applet you can request permission from the user to do certain activities that are otherwise restricted. But not all.
    - If you are using the JDBC-ODBC bridge then you need a different driver. If you sign your applet it might work in some limited scenarios but it will be hairy and is discouraged.
    - If you are using Access or another file based database (CSV Excel etc) then you are doomed. You'll have to get yourself a different database. A non file based one. It doesn't matter if you sign your applet or not. You're still doomed.
    - If you are trying to connect to a database server that is not at the same physical address as your web server you are doomed. Signing the applet will not help
    - Connecting directly to a database from an applet is extremely risky business. Starting with now anyone can steal your username and password for your database quite easily.
    What you should do in the redesign is put all the database accessing code in a Servlet. This Servlet does not have to be Java, it could be PHP, Perl, ASP, etc. It doesn't matter. Just put it on the server side. Then have your applet connect to this code via a webservice to do what is required.

  • How to get database connection in applet

    Hi,
    I am trying to prepare database connection in applet. After preparing connection with database it'll read same values from table.
    At the time of development it works fine. I have used esclipse IDE for coding and testing.
    But when I try to call that applet from browser. It is giving ClassNotFound exception.
    Does anybody know How to get database connection in applet ?
    Please help me if anybody know solution for this.
    Thanks,
    Rajesh

    As per my knowledge is conserned
    1 u can get the database connection in a jsp page and u send the result set as param to the applet and u can use retrieved values as if they were of the same applet if u r interested i can send the db connetion coding for jsp my id [email protected]

Maybe you are looking for

  • File extensions and other formats

    I'm having trouble with file extensions when saving AW files in other formats. I suspect it may have to to do with a recent upgrade to 10.5 I have (as recommended in the forum) deleted the AW plist files, but it didn't help. Here are the symptoms: 1.

  • Connecting to home internet via airport - always need to restart the router

    I set my home PC as the main station to connect to my ISP. With a wireless router (linksys Wireless-B), I used to share the internet connection to other wireless devices, for instanace, my palm and ibook, my sister's notebook PC and Pocket PC. once,

  • Wiki pages - who created them

    Hi There, is there a way for an admin to determine who created a Wiki page?

  • Settings: firefox will not accept easy hideIP. cannot get firefox proxy settings changed.

    easyhideIP will not be accepted by firefox and the prosxy settings of firefox will not change. They are set to auto accept but that does not work, the reload feature does not work. I have uninstalled firefox and reinstalled and the problem persists.

  • Developer Support Tools for OS X

    What are the recommended tools roughly equivalent to Rational Purify Plus suite in OS X? (Purify, Code Coverage, Quantify) I know of Shark, gcov and the common stuff that is either FOSS or ships with XCode... are there others? [commercial or otherwis