Results 1 to 11 of 11
  1. #1
    mayanksmart4 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default How to run Applet with Ms Sql connectivity in browser

    I have made MS SQL connectivity in APPLET code using JFRAME. When i'm running it in NETBEANS IDE, the program is running successfully, data from the DB is shown on the JFRAME. The problem arises when i'm ruuning that applet in my browser only the JFRAME is shown, data from the DB is not shown. I have placed the MS-SQL Drivers in the same directory where the applet code is.
    I don't know why it is happening.
    Please suggest some solution of this problem.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default Re: How to run Applet with Ms Sql connectivity in browser

    Are there any error messages in the browser's java console?

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: How to run Applet with Ms Sql connectivity in browser


  4. #4
    mayanksmart4 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: How to run Applet with Ms Sql connectivity in browser

    Quote Originally Posted by Norm View Post
    Are there any error messages in the browser's java console?
    As such there are no error messages..

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default Re: How to run Applet with Ms Sql connectivity in browser

    Try debugging the applet by adding some println statements to show where the program is executing.
    The print outs will be in the java console.

    Check all your catch blocks and make sure that they call printStackTrace()

  6. #6
    mayanksmart4 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: How to run Applet with Ms Sql connectivity in browser

    I am getting these Exceptions



    Exception in thread "AWT-EventQueue-1" java.lang.NoClassDefFoundError: com/microsoft/jdbc/base/BaseDriver
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
    at sun.applet.AppletClassLoader.findClass(AppletClass Loader.java:178)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.applet.AppletClassLoader.loadClass(AppletClass Loader.java:127)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at AppletDatabase.actionPerformed(AppletDatabase.java :115)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.jav a:6038)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
    at java.awt.Component.processEvent(Component.java:580 3)
    at java.awt.Container.processEvent(Container.java:205 8)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
    at java.awt.Component.dispatchEvent(Component.java:42 40)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429 )
    at java.awt.Component.dispatchEvent(Component.java:42 40)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default Re: How to run Applet with Ms Sql connectivity in browser

    NoClassDefFoundError: com/microsoft/jdbc/base/BaseDriver
    where is the definition for class named in the error message?
    You probably need to add a jar file that contains that class's definition to the archive= attribute

  8. #8
    mayanksmart4 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: How to run Applet with Ms Sql connectivity in browser

    how to do so??
    Dont know how to provice class definitions, please help me. describe in detail , if possible..

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default Re: How to run Applet with Ms Sql connectivity in browser

    Sorry, I have no idea where your missing class definition is.
    You need to find an HTML reference manual to get the correct coding syntax for your HTML.

  10. #10
    mayanksmart4 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: How to run Applet with Ms Sql connectivity in browser

    Somehow I have managed to solve some exceptions at run time, but I am still getting dese errors


    C:\Users\mayanks.sw\Desktop\testabc\z>appletviewer AppletDatabase.java
    java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)
    at java.security.AccessControlContext.checkPermission (AccessControlContext.java:323)
    at java.security.AccessController.checkPermission(Acc essController.java:546)
    at java.lang.SecurityManager.checkPermission(Security Manager.java:532)
    at java.lang.SecurityManager.checkExit(SecurityManage r.java:744)
    at javax.swing.JFrame.setDefaultCloseOperation(JFrame .java:377)
    at AppletDatabase.init(AppletDatabase.java:94)
    at sun.applet.AppletPanel.run(AppletPanel.java:417)
    at java.lang.Thread.run(Thread.java:619)


    Please help me.

  11. #11
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default Re: How to run Applet with Ms Sql connectivity in browser

    access denied (java.lang.RuntimePermission exitVM.0)
    Applets are not allowed to call System.exit(0);

Similar Threads

  1. How to run applet in a web Browser?
    By elururajesh3 in forum Java Applets
    Replies: 4
    Last Post: 11-06-2011, 09:34 AM
  2. applet working in applet viewer, not browser
    By plasticfood in forum Java Applets
    Replies: 4
    Last Post: 06-24-2011, 06:47 PM
  3. applet with database connectivity
    By priyacvr in forum Java Applets
    Replies: 13
    Last Post: 05-06-2010, 07:44 PM
  4. Applet Slideshow in web browser
    By Urgle in forum New To Java
    Replies: 0
    Last Post: 12-01-2008, 04:30 AM
  5. applet won't run in browser...
    By shwein in forum Java Applets
    Replies: 6
    Last Post: 10-17-2008, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •