How to Detect Database Conneciton Lost in Applet

Hi,
Is there a way to detect loss of database conneciton or network conneciton in an applet while it is running? We have an applet application and want to perform some database updates based on loss of database or network connectivity while the applet is running.
Just thinking out loud - is there a way to use some thread that constants runs in the loaded applet code and checks for database or network connectivity.
Thanks

That will be a manual process since we will know the list of users who had logged in thru the logs. What we are trying to do is to limit the concurrent connections for the users to the system. So if a conneciton is lost the users current count has to be decremented.
The select query you mentioned is trivial but how can we make this run all the time in the background. Do we use some thread etc?

Similar Messages

  • How to detect JRE with Javascript and without any help of class file

    Please tell me how to detect JRE with using the Applet file. Is it possible to detect only through Javascript

    It is possible to detect the Sun JRE using only Javascript without any class file.
    However, it is rather complicated due to difficulties with Internet Explorer.
    http://forum.java.sun.com/thread.jspa?threadID=5177843&tstart=15
    http://www.pinlady.net/test/PluginDetect.htm

  • 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]

  • How to detect Applet has been stopped or killed...

    Hello,
    I'm working on a Swing Applet that creates Annotations
    I want to detect when the browser or Applet have been killed so that i can save the Annotation objects into XML format.
    currently I have put the code to save the Annotations into XML format in the stop() method but this does not seem to be called. does this method get called automatically? or do I have to manually call it?

    You may want to try using the destroy method rather than the stop method. Both stop and destroy are automatically called. Stop code is executed everytime the user leaves the page containing the applet, destroy is called when the browser exits. Java guarantees to call this method when the browser shuts down normally.
    The problem is probably a security issue tho. Have you given the applet sufficent rights to write the annotations file to the location it has chosen?
    And finally, if your not sure if the stop code is being executed why not make it pop up a dialog box or something to show that it's executing the code? It's more likely to be able to complete a dialog box command without error than file writing commands, ne?
    Hope this helps.

  • How to detect the path of Temp directory

    I am writing a class library which allows users to manipulate a database in the web server java applications/applets. In my logic the Application/Applet communicate with a CGI script/Servlet in the server and that do all the database handling. My objective is to make the Client independant from the Database Drivers, and to some restrictions and possible security threats that can arrice when accessing the database directly.
    99% of the work is done and now I am doing the fine tuning.
    My Problem:
    When the user downloading a blob object from the server database. each time the program read the blob it will get a new copy from the server. This is not good if the blob is large (few 100 megs) . So I am going to implement a cache system. but the problem is If I am caching in the memory it will not support large objects (Memory is a limited factor). So the preferance is use the Temperary files but I do not know how to detect the path to temperary folder.
    And my 2nd questions is are the applets allowed to write and read in temperary folder.

    The Java default temporary file path can be determined with
    System.getProperty("java.io.tmpdir")This is typically the same value as the os environment variable

  • ANSWER: HOW TO DETECT Java Plugin from JavaScript

    I created a new topic because the questions about
    how to detect Java Plugin in browsers are scattered
    thoughout this forum.
    Basically you need to employ two approaches for IE and NS.
    In IE you need to try to instantiate a small applet
    (not your production applet) in order to see if browser
    can do it. if the browser can do it, you can make a
    call applet from JavaScript in order to find version of
    JRE (as well as a host of other things).
    In NS you can write a simple JavaScript which will
    interrogate the browser for all plugins installed. Then
    ypu can make a desicion whether to pass execution to
    the next(or generated) page which hosts your applet,
    or ask the user to download/install a plugin.
    I ecourage everybody to host a plugin on your site
    rather leave default link to it which is generated by
    html converter.
    In order to run sample,
    Prerequisites:
    Java Plugin 1.3.
    If you have a different version of plugin,
    substitute hardcoded plugin version in JavaScript for
    value that you have.
    1. compile java file
    2. put class file in the same directory with html file
    3. load html file into the browser.
    4. press "Check Java Plugin.." button
    5. see it work
    6. examine code
    7. uninstall plugin
    8. repeat steps 1 - 4
    9. see it work
    10. install plugin.
    Sample code follows:
    **********************HTML FILE BEGIN***********
    <HTML>
    <HEAD>
    <!-- Generated by Kawa IDE -->
    <TITLE>Detect Java Runtime</TITLE>
    </HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    var browsername;
    function doNetscape()
    for (i=0; i < navigator.plugins.length; i++)
    for (j = 0; j < navigator.plugins.length; j++)
    if(navigator.plugins[i][j].type == "application/x-java-applet;version=1.3")
    alert("You are running Netscape with Java Plugin 1.3.0 - OK");
    return;
    alert("You are running Netscape\nPlease, install Java Runtime Environment 1.3.0");
    function doMicrosoft()
    var applet = document.myApplet;
    if(applet == null)
    alert("You are running Microsoft Browser.\nPlease, install Java Runtime Environment 1.3.0");
    return;
    var version = applet.getJavaVersion();
    if(version == "1.3.0")
    alert("You are running IE, Java Plugin 1.3.0 installed - OK");
    else
    alert("You are running IE, other plugin installed - mybe OK if later that 1.3.0\nYour version: " + version);
    function getJava()
    var applet = document.myApplet;
    if(applet == null)
    alert("Please, install Java Runtime Environment");
    return;
         alert("JRE Version: " + document.myApplet.getJavaVersion());
    function checkJavaPlugin()
         browsername = navigator.appName;
         if(browsername.indexOf("Netscape")!= -1)
              browsername="NS";
              doNetscape();
         else
              if(browsername.indexOf("Microsoft")!=-1)
                   browsername="MSIE";
                   doMicrosoft();
              else
                   browsername="N/A";
                   alert("Unknown browser: " + browsername);
    </SCRIPT>
    <body>
    <Strong>Check Java Plugin</strong>
    <OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
         WIDTH = 1
         HEIGHT = 1 >
         <PARAM NAME = CODE VALUE = "DetectPluginApplet.class" >
         <PARAM NAME="scriptable" VALUE="true" >
         <embed type="application/x-java-applet;version=1.3"
              code = DetectPluginApplet width = 2 height = 2 MAYSCRIPT = "true" >
         </embed>
         </EMBED>
    </object>
    <FORM>
         <INPUT TYPE="button" value="Get Plugin Version in IE" onClick="getJava()">
         <INPUT TYPE="button" value="Check Java Plugin in NS and IE" onClick="javascript:checkJavaPlugin()">
    </FORM>
    </BODY>
    </HTML>
    **********************HTML FILE END***********
    ***************APPLET FILE BEGIN***********
    import java.awt.*;
    public class DetectPluginApplet extends java.applet.Applet
         public void init()
              add(new Label("DetectPluginApplet"));
    public String getJavaVersion()
    return System.getProperty("java.version");
    **************APPLLET FILE END************

    Try following java script, it works on new browsers (NS 4+, IE5+). For IE you have to enable 'ActiveX objects creation' in security options.
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
    && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.0") !=-1));
    var is_ie5up = (is_ie && (is_major == 4)
    && ( (agt.indexOf("msie 5.0")!=-1)
    || (agt.indexOf("msie 5.5")!=-1)
    || (agt.indexOf("msie 6.0")!=-1) ) );
    var pluginDetected = false;
    var activeXDisabled = false;
    // we can check for plugin existence only when browser is 'is_ie5up' or 'is_nav4up'
    if(is_nav4up) {
    // Refresh 'navigator.plugins' to get newly installed plugins.
    // Use 'navigator.plugins.refresh(false)' to refresh plugins
    // without refreshing open documents (browser windows)
    if(navigator.plugins) {
    navigator.plugins.refresh(false);
    // check for Java plugin in installed plugins
    if(navigator.mimeTypes) {
    for (i=0; i < navigator.mimeTypes.length; i++) {
    if( (navigator.mimeTypes[ i].type != null)
    && (navigator.mimeTypes[ i].type.indexOf(
    "application/x-java-applet;jpi-version=1.3") != -1) ) {
    pluginDetected = true;
    break;
    } else if (is_ie5up) {
    var javaVersion;
    var shell;
    try {
    // Create WSH(WindowsScriptHost) shell, available on Windows only
    shell = new ActiveXObject("WScript.Shell");
    if (shell != null) {
    // Read JRE version from Window Registry
    try {
    javaVersion = shell.regRead("HKEY_LOCAL_MACHINE\\Software\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
    } catch(e) {
    // handle exceptions raised by 'shell.regRead(...)' here
    // so that the outer try-catch block would receive only
    // exceptions raised by 'shell = new ActiveXObject(...)'
    } catch(e) {
    // Creating ActiveX controls thru script is disabled
    // in InternetExplorer security options
    // To enable it:
    // a. Go to the 'Tools --> Internet Options' menu
    // b. Select the 'Security' tab
    // c. Select zone (Internet/Intranet)
    // d. Click the 'Custom Level..' button which will display the
    // 'Security Settings' window.
    // e. Enable the option 'Initialize and script ActiveX controls
    // not marked as safe'
    activeXDisabled = true;
    // Check whether we got required (1.3+) Java Plugin
    if ( (javaVersion != null) && (javaVersion.indexOf("1.3") != -1) ) {
    pluginDetected = true;
    if (pluginDetected) {
    // show applet page
    } else if (confirm("Java Plugin 1.3+ not found, Do you want to download it?")) {
    // show install page
    } else {
    // show error page
    }

  • How to recover database without controlfile and redo files?

    Hi all,
    If I just have datafiles using hot backup saving in another machine, and all files in current database were lost including data files,control files and redo log files .
    How can I recover database just using hot backup datafiles? without control file, without redo files.
    Your help is greatly appreciated.

    alter database backup control file to trace
    SQL> alter database backup controlfile to trace;
    Go to udump folder in oracle home folder check the trace file copy these lines
    CREATE CONTROLFILE REUSE DATABASE "O10G1” NORESETLOGS NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 454
    LOGFILE
    GROUP 1 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO01.LOG' SIZE 10M,
    GROUP 2 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO02.LOG' SIZE 10M,
    GROUP 3 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO03.LOG' SIZE 10M
    -- STANDBY LOGFILE
    DATAFILE
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\SYSTEM01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\UNDOTBS01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\SYSAUX01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\USERS01.DBF'
    CHARACTER SET WE8MSWIN1252
    Change the new database name “abc
    ” and REUSE replaced by SET and NORESTLOGS replaced by RESTLOGS above lines.
    Save as C1.sql
    C:\ set oracle_sid=instance name
    C:\>sqlplus /nolog
    SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr
    11 06:44:28 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    SQL> connect / as sysdba;
    Connected to an idle instance.
    SQL> startup nomount
    pfile='C:\oracle\product\10.1.0\admin\jeeno\pfile\jeenoinit.ora'
    ORACLE instance started.
    Total System Global Area 171966464 bytes
    Fixed Size 787988 bytes
    Variable Size 145750508 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 262144 bytes
    SQL> @c1.sql
    Control file created.
    SQL> alter database open resetlogs;
    Database altered

  • Cannot connect to database in a signed applet

    Hi i have an applet that connects to a database and does stuff. However when I move the applet to a different server i get errors. I did sign the applet but i still get
    java.security.AccessControlException: access denied (java.net.SocketPermission <server> resolve)
    Do I have to explicitly allow the applet to open a socket to this server, do I have to set up policy files and how exactly is this done? Please explain in detail
    Thanks

    First, don't use applets to connect to the database directly.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file using doprivileged
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • How to detect modifications in an ABAP Object?

    Hi all,
    I was wondering if there's a simple way of detecting modifications in an ABAP Object.
    Imagine an ABAP entity object which holds several attributes and you need to know if this object has been modified. Instead of having to check attribute by attribute to compare it's previous value with the new one I came with the idea of calculating a HASH code for the object before the execution of the application which can change the object attributes and comparing it with the HASH calculated for the same object after the execution.
    That way, checking only two hashes simplifies a lot the code. So.... is there any way of calculating a HASH for any object instance? if not... any other approach?
    Thanks in advance.

    Sorry Hüseyin Dereli, but I'm not talking about source version control, but how to detect attribute modifications of an ABAP Object Instance.
    for example, suppose you have a program which reads data from DataBase and stores temporally that data into an ABAP Object like this:
    ABAP Object AAAA{
       private attr1
       private attr2
    and passes this ABAP Object into a screen for user interaction, or even a FunctionModule or Method or anything else...
    data: myObject type ref to AAAA.
    myObject-attr1 = 1
    myObject-attr2 = 2.
    CallFunction AnyFunction Changing data = myObject
    After the execution of AnyFunction I would like to know if myObject has been changed but I'm trying not to check attribute by attribute because if myObject has a lot of attributes (not in this example but in the real source code)
    It would be great if we could do something like this:
    data: myObject type ref to AAAA,
              oldHash type hash,
               newHash type hash.
    myObject-attr1 = 1
    myObject-attr2 = 2.
    oldHash = myObject->get_hash()
    CallFunction AnyFunction Changing data = myObject
    newHash = myObject->get_hash()
    if oldHash NE newHash.
    * MyObject has been modified
    endif.

  • How to Detect browser crash

    hi i want to know how to detect browser crash or the way to go about it , i can use any language to any api's plz specify me some solution .It would be really healpfull

    paul_123 wrote: hi i want to know how to detect browser crash ..
    Like the other person that replied, I do not quite understand why it is of interest that the end user's browser crashes. If, like they suspect, it is to do with your applet, I think the best solution is to launch the applet using webstart and forget the browser. If the end user launches a webstart based applet from the browser and the browser crashes, the applet will keep working just fine.
    Is your applet publicly available? If so, what is the URL where we can see it?

  • Delete database with lost initdb.ora

    Hi guys. How can i delete database with lost init file? I just want to recreate the database (with out any recovery or restoring process)
    1. I can't start it because i don't have init.
    2. I can't drop database because i can't start.
    3. I can't recreate database using dbca because the same name somewhere exists:(
    Edited by: America on Jan 18, 2009 12:03 PM

    1. I can't start it because i don't have init.
    recreate init file... you can copy init.ora to init<SID>.ora and then modify DB_NAME and control_files parameters...
    2. I can't drop database because i can't start.
    You can delete manual by remove datafiles, redo file and control files ... After that use "DBCA" to force remove....
    3. I can't recreate database using dbca because the same name somewhere exist
    On DBCA .... You should delete old database before....
    DBCA can delete your database ... by not start database ... that remove databae name from oracle.... But, You have to manual delete on location PATH... Before start "DBCA" to create new database....

  • Trigger invalidations, how to detect cause?

    Hello,
    is it possible to somehow detect what causes object(PKG/PRC/FNC/TRG) invalidations?
    Application users doesn't have righst to compile the object. After invalidation object can be again successfuly recompiled by ALTER XXX COMPILE; command. For example we are using after logon trigger for application users, this trigger gets sometimes invalidated for no obvious reasons, users are unable to login to the database because they're hitting permission denied upon trying to compile this trigger. Any hints on how to detect what is the cause of these invalidations?
    Thank you,
    D.

    Hm, what if I found out that last DDL time with the latest date were the following objects:
    SYS.DBMS_STANDARD
    SYS.DICTIONARY_OBJ_NAME
    SYS.DICTIONARY_OBJ_TYPE
    SYS.STANDARD

  • How to make the oracle forms 10g applet or runtime the size of 1024x768?

    Hi,
    Can anyone tell me
    How to make the oracle forms 10g applet or runtime the size of 1024x768?
    Thanks in advans..

    Please post your question in Forms Topic
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Oracle XML vaidation causes database connection lost.

    Schema document:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xsd:annotation>
              <xsd:documentation xml:lang="en">
              </xsd:documentation>
         </xsd:annotation>
         <xsd:element name="BDDString" type="xsd:string"/>
    </xsd:schema>
    XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <BDDString><Path>USA</Path></BDDString>
    Result http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx validation:
    Validation error:
    <?xml version="1.0" encoding="UTF-8"?>
    <BDDString
    Error at (2,14): The element 'BDDString' has invalid child element 'Path'. An error occurred at , (2, 14).
    Error at (2,14): The 'Path' element is not declared. An error occurred at , (2, 14).
    <Path>USA</Path></BDDString>ORACLE validation:
    Declare
         xmlObj XMLType;
    begin
         xmlObj := XMLType('<?xml version="1.0" encoding="UTF-8"?><BDDString><Path>USA</Path></BDDString>',
         'cb78db306e061027a7c4b02b1a84d6fb');
         XMLType.schemavalidate(xmlObj);
    end;
    Result: Oracle XML vaidation causes database connection lost!
    *** SCRIPT START : Session:M1GLOBAL_DEV15@MATRIX(5) 3-&#1084;&#1072;&#1088;-2005 14:05:41 ***
    Start SQL Editor Execution ...
    Processing ...
    xmlObj := XMLType('<?xml version="1.0" encoding="UTF-8"?>
    ORA-03113: end-of-file on communication channel
    *** SCRIPT END : Session:M1GLOBAL_DEV15@MATRIX(5) 3-&#1084;&#1072;&#1088;-2005 14:08:02 ***
    End SQL Editor Execution
    Task "SQL Editor Execution": Operation aborted
    SQL Editor Execution terminated with errors
    Task "SQL Editor Execution" in DoTerminate(): Session Manager: No connection to M1GLOBAL_DEV15@MATRIX
    Help!
    Question:
         1)Why Oracle validation incorrectly works?
         2)How it to correct?

    Hi,
    1- what is the Reports version being used?
    2- What is the error you are getting?
    3- Have you tried to enable reports trace and see what is happening in trace file?
    Thanks, Roberto

  • EM 12C: Fails to detect database related targets

    Hi
    I have been trying to add database target on a remote host but fails to detect it as its looking into a wrong ORACLE_HOME directory how can I make it to look into the right ORACLE_HOME,
    the ORACLE_HOME is already defined in .bash_profile however its reading GRID_HOME as ORACLE_HOME and fails to detect database and related targets, I have already added the cluster target and want to add database related targets for the RAC.
    Thanks for your help.
    Regards
    Terry

    Terry,
    Have a look at support bulletin "Understanding Database Discovery in Enterprise Manager 12cCloud Control [ID 1400463.1]". The oracle home location is pulled from oratab which the agent needs access to ( see section "Has the database been discovered" ) for details.
    Let us know if the resolves your issue.
    Regards,
    Dave

Maybe you are looking for

  • View a Detailed report from a link in a General Report?

    Greetings all, I have no idea why I am confused on what I am trying to do. I have a Report that Generates a tabluar view off all tickets the actual ticket has 25 fields to be filled in, but of course on the tabular view, I only have four of the relev

  • Is it possible to format a hard drive with HFS  for a Macbook on a PC?

    I recently received a Macbook hard drive for my niece. She trashed her Macbook to the point that i is not worth repairing. I usually work with PCs and am a hardware familar with Macs. I have a ineterested party for the hard drive but they want me to

  • Can you group emails into conversations by drag and drop?

    Conversations in Mail is working fine.  However, sometimes there are messages that don't link because they are from the same person but a different time or not in the current "related" group? Can you MAKE them group into the conversation somehow?

  • Lightroom - Edit Original In Photoshop - Serious Rendering Issue

    It kinda bothers me that it seems no one else on the entire internet has had this problem... This actually started happening when I was using LR2 and CS4 several months ago, and for some reason the problem came with me through to LR3 and CS5... but w

  • Veritas required for Oracle RAC on Sun Cluster v3?

    Hi, We are planning a 2 node Oracle 9i RAC cluster on Sun Cluster 3. Can you please explain these 2 questions? 1) If we have a hardware disk array RAID controller with LUNs etc, then why do we need to have Veritas Volume Manager (VxVM) if all the LUN