Applet - Database communication thro' browser

I want to know how to communicate applet with database using Internet Explorer Browser. We can communicate applet with database using appletviewer. But in IE it is showing "sun.jdbc.odbc.JdbcOdbcDriver not found" Exception. For that I took the sun.jdbc.odbc.JdbcOdbcDriver class from jdk, made it as a jar. I added the jar to the archive attribute of the applet tag. After that browser is showing suitable driver not found excption. How can I solve this problem? Please Help me.

Hi,
Microsoft changed the name of the JBDC driver.In order to get it
to work for IE you will need to change the name of the driver to
com.ms.jdbc.odbc.JdbcOdbcDriver.
Alternatively, you can install the Java 2 plugin for your browser.
HTML Converter will generate the .html to use the Java 2 plugin.
See the following for more information about the HTML for using the Java 2 plugin:
http://java.sun.com/products/plugin/index-1.4.html and
http://java.sun.com/products/plugin/1.3/features.html
Hope this helps.
Good Luck.
Gayam.Srinivasa Reddy
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support/

Similar Messages

  • Applet javascript communication

    hi all,
    I want my applet to flash the browser window, came to know that can be done
    using applet javascript communication.
    ne1 has ne idea how to do that.
    thx in adv,
    kiran

    ???

  • Inter applet network communication

    Hi
    Is this senario possible?
    Webserver W provides the applet A to two browser clients at two different IP addresses. The applets now instanciated are informed about the direct IP address of oneanother. Then the webserver is stopped.
    Can the applets now communicate directly? I would really like to know if there is a workaround for this as it could serve my purposes for a distributed prototype.
    Cheers,
    Rasped

    No, its not directly.
    It would work if you signed the applets. Digitally signed applets are allowed security priveledges like opening network connections to servers other than where they originated.
    What are you trying to do? I see posts regarding regressions, image processing, and sneaky, back door communicating applets.
    Have fun

  • Problem in Applet Servlet communication in cluster

              Our new production server has been configured with
              clusters very recently.The application is running fine if and only if one instance
              of weblogic is running.The application has two applets that communicate through a
              servlet and the servlet is hosted by both the WL servers in the cluster.
              Please consider the following scenario :
              1. JSP#1(having embedded tag for Applet#1) is served by, say, WLInstance#1.
              2. JSP#2(having embedded tag for Applet#2) is served by, say, WLInstance#2.
              3. Applet#1 is loaded by BrowserInstance#1.
              4. Applet#2 is loaded by BrowserInstance#2.
              The way I understand applet-servlet communication is as follows :
              The servlets are invoked through the url-pattern specified in web.xml - if the applet
              is making use of a certain url-pattern that is mapped to servlet, then the call from
              that applet will
              eventually invoke a servlet on any of the two instances till a session is established,
              at which point all subsequent requests from the same browser window/frame will go
              to the servlet hosted on the instance where the http session was created.
              (Please correct me, if I am wrong.)
              So, Applet#1 will always talk to the servlet hosted by WLInstance#1 and Applet#2
              will always talk to the servlet hosted by WLInstance#2.
              In our case, the servlet is maintaining data structures to store all the messages
              sent by diffterent instances of Applets.
              The applets periodically polls the messages from those data structures.Once the messages
              are polled, those are deleted from
              the data structures.
              As there are two different instances of the servlet, Applet#1 never gets messages
              posted by Applet#2.
              Is there a way to make this data structure global to both the servlet instances?
              Thanks and best regards,
              Subir Das
              

              "Subir Das" <[email protected]> wrote:
              >So, Applet#1 will always talk to the servlet hosted by WLInstance#1 and
              >Applet#2
              >will always talk to the servlet hosted by WLInstance#2.
              This statement is not entirely true.
              Suppose WLInstance#1 were to be brought down (for whatever reason), Applet#1 will
              then talk to servlet hosted by WLInstance#2.
              Server pinning could be modified by different load balancing algorithms, configurable
              via containers (or hardware).
              So don't count on which servlet instance your applet is going to be served by.
              Instead consider to give a second look into the design of the servlet data structure
              (object):
              1.Read from data store, if it has been persisted.
              2.If the data is client related then consider sticking the data into session, which
              would then replicate to other WL instances.
              3.Stateless EJB in a cluster ? Don' know much about this(yet).
              My 2 cents..Good luck.
              Rama
              

  • Applet not viewable in browser

    Hi
    applet not viewable in browser any website that uses java code seems not to run on my browser though it runs normally well on my friends computer. The browser shows a screen area in grey colour with an error message like "Exception: java.lang.ClassNotFoundException:GUIDemo.class" (im using Win NT4 and IE 5.5) checked the tools/internet options/advanced seettings the browser support is enabled. tried installing the newer version of JRE still not working ..Please guide about any settings that need to be modified or how can i fix this problem ..
    Regards
    anant
    [email protected]

    Hi
    Just a thought, but what broswer are you and your friend using? Are they different by any chance?
    There is an inconsistency between browsers and java, and unfortunately it can result in the error you saw.
    Basically, bog standard Internet Explorer uses its own JVM, whereas Netscape, Mozilla, Opera etc tend to use the java plug-in. To make matters worse, if you install the plug-in on a machine that has Internet Explorer installed, it over-rules the Microsoft version to make itself the default (but this can be undone by looking in the Options menu for Java-plugin and un-ticking the box). Give that a try first.
    Another cause that I have encountered was when using NT on a network, which had been configured not to accept Java Applets at all! Are you on such a network, or stand alone?
    Hope that helps.

  • Applet/servlet communication for byte transmission

    Hello all !
    I wrote an applet to transfer binary file from web servlet (running under Tomcat 5.5) to a client (it's a signed applet) but I have a problem of interpretation of byte during transmission.
    the code of the servlet is :
            response.setContentType("application/octet-stream");
            ServletOutputStream sos = response.getOutputStream();
            FileInputStream fis = new FileInputStream(new File(
                    "C:\\WINDOWS\\system32\\setup.bmp"));
            byte[] b = new byte[1024];
            int nbRead = 1;
            while (nbRead > 0) {
                nbRead = fis.read(b);
                System.out.println("octets lus = " + nbRead);
                sos.write(b, 0, nbRead-1);
            fis.close();
            sos.close();et le code de l'applet qui appelle cette servlet est :
            URL selicPortal = null;
            try {
                selicPortal = new URL(
                        "http://localhost:8080/AppletTest/servlet/FileManipulation");
            } catch (MalformedURLException e) {
                e.printStackTrace();
            URLConnection selicConnection = null;
            try {
                selicConnection = selicPortal.openConnection();
            } catch (IOException e) {
                e.printStackTrace();
            selicConnection.setDoInput(true);
            selicConnection.setDoOutput(true);
            selicConnection.setUseCaches(false);
            selicConnection.setRequestProperty("Content-Type",
                    "application/octet-stream");
            try {
                InputStream in = selicConnection.getInputStream();
                FileOutputStream fos = new FileOutputStream(new File(tempDir
                        + "\\toto.bmp"));
                byte[] b = new byte[1024];
                int nbRead = in.read(b);
                while (nbRead > 0) {
                    fos.write(b);
                in.close();
                fos.close();
             } catch (IOException ioe) {
                ioe.printStackTrace();
            }the file dowloaded is broken. it seems that bytes 01 00 or 00 01 are not correctly process.
    Some ideas to help me please ?

    hi,
    have you solved this issue.. please post me the code since i m also doing the applet/servlet communication and can use your code as reference.
    how to read the content placed in the urlConnection stream in the servlet
    Below is my code in applet
    public void upload(byte[] imageByte)
              URL uploadURL=null;
              try
                   uploadURL=new URL("<url>");
                   URLConnection urlConnection=uploadURL.openConnection();
                   urlConnection.setDoInput(true);
                   urlConnection.setDoOutput(true);
                   urlConnection.setUseCaches(false);
                   urlConnection.setRequestProperty("Content-type","application/octet-stream");
                   urlConnection.setRequestProperty("Content-length",""+imageByte.length);
                   OutputStream outStream=urlConnection.getOutputStream();
                   outStream.write(imageByte);
                   outStream.close();
              catch(MalformedURLException ex)
              catch(IOException ex)
    How can i read the byte sent on the outstream (in above code) in the servlet.
    Thanks,
    Mclaren

  • Asynchronous applet-servlet communication

    Hi all,
    I am trying to implement asynchronous applet-servlet communication and need your help. Anything would help(I tried with synchronous applet-servlet communication but doesn't solve my problem).
    Thanks,

    http://java.sun.com/docs/books/tutorial/networking/index.html
    You can open a socket connection. Bother the client and the server
    can have separate threads for reading and writing and that you gives you
    asynchronous communication. Later, if you think the server is generating
    too many threads and not scaling, you can use features of .java.nio to
    make it more scalable:
    java.nio.channels

  • Is there a good advanced review on applet-servlet communication

    I am working on a web application and unfortunately experiencing a lot of trouble trying to use an applet as front end which interacts with a couple of servlets running on Tomcat. I need to get data from one servlet and send data to another.
    There is a lot of messages posted in this and other forums about how to do this, but none of them got a response pointing to a useful advanced reference on this subject. I have reviewed some of the references given, but couldn't find a thorough detailed advanced reference on applet-servlet communication. For this I mean an exhaustive explanation of the mechanism of communication and when and when is neccesary to use each of the multiple configuration possibilities regarding content-type, message-length, request-method, connection settings, and so on.
    Would anybody be so kind to show me the right direction? As I read the (literally) hundreds of messages posted on this topic, I see this info as widely useful. Most of the topic tracks ends on void or with painful no-way sentences, and maybe many people is avoiding Java technology on web application because of this problem (development delays can abort a project).

    This sample chapter in Java developers' guide to Servlets and Jsp focuses on Applet-Servlet communication, is a pretty good one, and is free :
    http://www.javaranch.com/bunkhouse/samps/2809ch12.pdf
    As to an exhaustive & complete guide that covers absolutely everything, I may be wrong but I doubt you'll find anything like that...unless there is a book somewhere dedicated to the subject.

  • JVM crashed when applet is loaded in browser

    when applet is loaded in browser after some time JVM crashedwith hs error log.
    i am using
    JRE 1.6.0_10,
    1GB RAM,
    XP SP3,
    IE6
    Error log
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d02bd1d, pid=6032, tid=4772
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-x86)
    # Problematic frame:
    # C [awt.dll+0x2bd1d]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    It appears from the following statement that a native code process failed when called by the jvm.
    The crash happened outside the Java Virtual Machine in native code.Not much more can be said. The cause does not appear to Java code.

  • Applet-servlet communication, object serialization, problem

    hi,
    I encountered a problem with tomcat 5.5. Grazing the whole web i didn't find any solution (some guys are having the same problem but they also got no useful hint up to now). The problem is as follows:
    I try to build an applet-servlet communication using serialized objects. In my test scenario i write a serialized standard java object (e.g. a String object) onto the ObjectOutputStream of the applet/test-application (it doesn't matters wheter to use the first or the latter one for test cases) and the doPost method of the servlet reads the object from the ObjectInputStream. That works fine. But if i use customized objects (which should also work fine) the same code produces an classnotfound exception. When i try to read and cast the object:
    TestMessage e = (TestMessage)objin.readObject();
    java.lang.ClassNotFoundException: TestMessage
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ...That seems strange to me, because if i instantiate an object of the same customized class (TestMessage) in the servlet code, the webappclassloader doesn't have any problems loading and handling the class and the code works fine!
    The class is located in the web-inf/classes directory of the application. I've already tried to put the class (with and without the package structure) into the common/classes and server/classes directory, but the exception stays the same (I've also tried to build a jar and put it in the appropriate lib directories).
    I've also tried to catch a Throwable object in order to get information on the cause. But i get a "null" value (the docu says, that this will may be caused by an unknown error).
    I've also inspected the log files intensively. But they gave me no hint. Until now I've spend a lot of time on searching and messing around but i always get this classnotfound exception.
    I hope this is the right place to post this problem and i hope that there is anyone out there who can give me some hint on solving this problem.
    Kindly regards,
    Daniel

    hi, thanks for the reply,
    all my classes are in the web-inf/classes of the web-app and have an appropriate package structure. thus the TestMessage class is inside a package.
    i tried some names for the testclass but it didn't matter. the exception stays the same. I also tried to put the jar in the common/lib but the problem stays.
    Well the problem with loaded classes: As i mentioned in the post above i can instantiate an object of TestMessage in the code without any problems (so the classloader of my webapp should know the class!!)
    only when reading from the objectinputstream the classloader doesn't seem to know the class?? maybe theres a parent classloader resposible for that and doesn't know the class?
    strange behaviour...
    p.s. sending the same object from the servlet to the client works well
    regards
    daniel
    Message was edited by:
    theazazel

  • Applet/Servlet communication - StreamCorruptedException

    Hi, I'm having a problem when I try to connect to a servlet. I am using applet/servlet communication. The problem only occurs when I have lauched a crystal report via http in a new window.
    After the report is launched if I try to hit my servlet I get the following error:
    java.io.CorruptedStreamException: invalid stream header
    Not all crystal reports I launch cause this behavior but I can see nothing in the url I use to launch the report that is out of place or different than other reports.
    APPLET-SERVLET CONNECTION
    try {
    StringBuffer path = new StringBuffer();
    path.append(ip);
    path.append("servlet/DatabaseServlet?");
    path.append("option=getRecords&query=").append(URLEncoder.encode(query,"UTF-8"));
    URL url = new URL(path.toString());
    URLConnection servletConnection = url.openConnection();
    servletConnection.setUseCaches(false);
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setRequestProperty("Content-Type", "application/x-java-serialized-object");
    ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
    rc = (RecordCollection) inputFromServlet.readObject();
    inputFromServlet.close();
    } catch (Exception e) {
    e.printStackTrace();
    SERVLET CODE
    Forwards to doPost
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    System.out.println("session id: " + request.getSession().getId());
    this.doPost(request, response);
    LAUNCHING REPORT FROM APPLET
    try {
    String launchURL = host + directory + report + "?promptOnRefresh=0"+ "&" +
    authentication + "&" + key + "&" + startPeriods + "&" + reportYears + "&" + reportTitle + "&" endPeriods "&" + locations + "&" + reportPeriod + "&" + fiscalWeek + "&" + fiscalYear + "&" +time;
    context.showDocument(new URL(launchURL), "_blank");
    } catch (Exception ex) {
    ex.printStackTrace();
    SAMPLE URL THAT CAUSES PROBLEM
    http://localhost:113/Reports/OpenToBuy_3.class?promptOnRefresh=0&user0=rpuser&password0=er34sw1&[email protected]=rpuser&[email protected]=er34sw1&user0@sub2=rpuser&[email protected]=er34sw1&promptex-key="L","L1","ALL"&promptex-start="1"&promptex-years="2004","2004"&promptex-title="Report Title"&promptex-end="1"&promptex-locs="01","03","04","05"&promptex-period="Feb 2004 [04-01]"&promptex-cw="1"&promptex-cy="2004"&promptex-time=-2-52728"
    Everything works fine until I launch this report then I can no longer get data from my servlet. I thought the URL lenght for the report might be the problem but I lauch a report with a URL longer than the problem one and there I don't get the errors after. When I try to connect to the servlet the println statement in the doGet method of my servlet doesn't get printed so it's not even making it inside that method in the servlet.
    Anyone have any idea what could be causing this? Anyone have any ideas what would be causing this? I'm really stumped.

    I've seen this problem before. Because your accessing a complete URL (ie http://<host>:<port>/xxx), you are actually creating a new session. Whenever the applet opens a connection to a servlet it is running on it's own session not the same as the JSP. This is rather obvious since the Page and Applet are separate entities.
    Try sending authentication with the url. I think the syntax is:
    username:password@http://localhost/xxx
    However I'm not sure how well this might work for Tomcat. As for Java it may try and throw a MalformedURLException I would have to test it first - it's been a long time since I used this technique!
    Wish I could be more help,
    Anthony

  • How to display Applet window in user browser?

    Hi,
    Can anyone help me in displaying the applet in the user browser.
    I am using a java script method(callApplet) in my JSp page which will be invoked when a button is clicked.
    So when the button is clicked the i am getting the new window, but the applet window is not displaying i am
    getting just a blank image.
    I guess we have to change in browser setting for enabling the applet window.
    Can anyone help me where we have to enable for applet setting in our browser (ie browser setting) or do we need to install any software for viewing the applet window.
    Here is my code to display the applet in browser:
    My JSP Page includes below code:-
    function callApplet()
         window.open("http://infch00878:8080/USMS-Local/jsp/home1.html");
    And home1.html file is :-
    <html>
    <applet code="aDraw.class" archive="aDraw.jar" width="520" height="330" name="aDraw">
    <param name="url" value="http://infch00878:8080/adraw/jsp/save.jsp">
    <param name="save" value="Save">
    <param name="bgcolor" value="#F0F0F0">
    <param name="image" value="test2.jpg">
    <param name="sizeW" value="430">
    <param name="sizeH" value="450">
    <param name="bouton" value="D:\test\bouton.gif">
    </applet>
    </html>
    Thanks in advance for your help.

    I'll ask the same question again: does the applet work in AppletViewer (if you do not know what appletviewer is, you should review Sun's documentation on applets - http://java.sun.com/docs/books/tutorial/deployment/applet/ )? It is easy to diagnose problems when you have certain steps to at which tobreak the problem apart...here, if the applet does not work in Appletviewer, than the problem is with the applet or your link to the applet in the html, and not anything downstream of that.

  • Applet, Application communication

    Hi
    Someone tell me how to do applet, application communication.
    I have one standalone application, running in server and receiving connection from applets and every min. the server has to send some data back to each apllet connected.
    How to do it... any sample or reffernces please..
    Thanks in advance
    Tomy

    Can you give me example codes using RMI / Socket
    thanks

  • Error #1015: Database Communication Error

    Hi,
    I am having a WebCTRL application on my infra which is connecting to SQL server 2008 R2.
    On application side, we are frequently getting error messages saying that ,
     Error #1015: Database Communication Error   --   Critical problem occurred (With timings) Reestablished (DBname) database connection.     details: Successfully reconnected to the database
    i dont see any errors on SQL server logs as well as event logs on the server.
    Is it happening because of SQL server ?
    Is there anything i missed to check ? 
    Please help me to solve this issues.
    Regards,
    Vinodh Selvaraj

    Can you check if your database properties set Auto Close to ON , it must be set to OFF
    https://msdn.microsoft.com/en-us/library/bb402929.aspx
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Connecting to the Oracle8i database from the browser

    Can any one please tell me the architecture requirements and setup for connecting to the orcle 8i database from the browser. I am dummy in internet programming but I would like to learn it.
    We currently have "Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production" installed on HP-UX B.11.00 server with "JServer Release 8.1.7.4.0 - 64bit Production"
    Basically I want to create a simple ADD/MODIFY/DELETE/VIEW screen in the browser,
    connecting to the oracle 8i database, select data and display it on the browser.
    In order to achieve this, what should I install in the Oracle database or what should I check in the database to see if that is installed already.
    Currently it has the Java pool created, clasess installed already and also the XML
    packages installed already. (i.e XMLGEN, XMLPARSER, XML....)
    what are the other O/S level set up is necessary. I currently have "Microsoft Internet Explorer" 4.72 version.
    Thanks in advance.
    Pushparaj

    hi ,
    well you can do it by using PL/SQL web tool kit packages.
    HTP package,OWA_ packages...
    Mostly these are there with in 8.1.7.
    Check by logging into SYS user
    select * from all_objects where object_name like 'OWA%'
    No need of wasting intially ur time in XML or any thing.
    So see the package body and nowing that u can write your own procedure using those packages.
    and deploye it in jserver.
    we have done and it's working
    all the very best
    [email protected]

Maybe you are looking for