JDBC functions in a JS file?

Is it possible to use JDBC functions in a .js file? If not, is there an alternative? I need to make database queries from a .js file
Thanks in advance.

You might be able to use AJAX like the previous poster suggested.
In javascript there is an object called XMLHttpRequest. You can use this object to make requests to your servlet without having the browser reload the page. It happens behind the sense, essentially hiding any activity from the user visting your page. You could use this object in your .js file to send a request to your servlet, your servlet would then query your database, and then your servlet would build and XML document containing the data you needed from your database and send the XML repsonse back to the page.
Read up on AJAX. There are some tutorials floating around on the web.
-S

Similar Messages

  • Crash on search function for HTML Help file (.chm) when connected to a Visual C++ application

    Crash on search function for HTML Help file (.chm) when
    connected to a Visual C++ application
    I use the RH_ShowHelp API command to connect a HTML Help file
    (.chm file generated by RoboHelp Word X 5) to my Visual C++
    application. My application is able to call up this HTML help file
    in context-sensitive mode and everything is working great in the
    Contents and Index panels EXCEPT when I click on List Topics (after
    I enter a KEYWORD for search) in the Search panel.
    I got an error that said “Unhandled exception in
    xxxx.exe.(HHCTRL.OCX):0xC00000FD: Stack overflow”
    I am able to execute this .chm file by itself and the search
    function works well in this case. I am using HHActiveX.dll that is
    created on 2/23/04. Is this the correct version?? Any advice what
    to do here??

    Hi agschin and welcome to the RH forums. The hhactivex.dll
    file is not used by the search function so you can rule that our.
    Have you tried recompiling and seeing if the problem still happens?
    You can also start the Bug Hunter feature in RH - View > Output
    View and then select the Bug Hunter button - and see if that throws
    up any clues.

  • Gui_download function to download the file in application server in bdc

    Can we use gui_download function to download the file in application server in bdc?
    Regards,
    pandu.

    for downloading the file on application sever you use the concept of Dataset. GUI_DOWNLOAD is for presentaion server.
    regards
    Abhi

  • HANA Server site JavaScript how to call functions in another .js file? thanks

    In HANA Studio, I have created a .js file and a server site javaScript .xsjs file. The .js file and .xsjs file are in the same path .I create function F1() in js file. Then I want to call function F1 in xsjs file. But it always through an error “f1 was used before it was defined”. Any suggestion? Thanks very much
    .js file:
    .xsjs file:

    Hi Jim,
    Now I have found the method how to use external library. If we want to outsource some of xsjs functions to an external library, XSEngine provides a special format for this, called “.xsjslib”. Then in xsjslib file, we define functions need to be outsourced.
    In .xsjs file, we can import a library using the following code:
    $.import("<Package_Library_was_deployed>","xsjslib File Name");
    The Package_Library_was_deployed please refer to:
    Access functions inside library by this path:
    $.Package_Library_was_deployed.xsjsFileName.FunctionName();

  • [svn] 4159: Enhancement SDK-18016 - updating mxmlc' s Embed functionality to recognize .pbj files as precompiled Shader files.

    Revision: 4159
    Author: [email protected]
    Date: 2008-11-21 13:06:29 -0800 (Fri, 21 Nov 2008)
    Log Message:
    Enhancement SDK-18016 - updating mxmlc's Embed functionality to recognize .pbj files as precompiled Shader files. This change still retains the old octet stream MIME type mapping to a ByteArray based class, but this change removes the hoop you have to jump through to embed a Shader. The new Embed usage should simply be as follows:
    [Embed(source="TubeView.pbj")]
    private var TubeViewClass:Class; //Subclass of flash.display.Shader
    Also updating Embed MIME types to recognize .dfont files since these are supported by CFFFontManager.
    Finally, updating FXG TextGraphic -> SymbolClass to use a simple FlexSprite instead of a Group. TextGraphic should now render at the right depth among SWF graphics primitives when compile time optimized FXG is used.
    QE: Yes
    Doc: If we've documented embedding .pbj, this is a simpler approach and represents a slight change in syntax.
    Checkintests: Pass
    Reviewer: Corey (Note he said he'll update ShaderFilter with a new property to accept a shader directly in a future check-in).
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18016
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ShaderFilter.as
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/EmbedUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/TextFXGGraphics.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/TextHelper.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/DataTranscoder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/FontTranscoder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/MimeMappings.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/WebTierAPI.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/PBJTranscoder.java

  • Calling a function in an EXE file from Java Program

    Hi Im having a function which is written in c program.i need to call that function from my java program, if i create a shared library (DLL) for my C code then it works but my requirement is i dont want to create that DLL , like in it would be an executable and my java code should access that function in that C program

    I understand the usage od a DLL but the thing is if i convert the exe to a DLL
    the server doesnt start at all so what i need is that i dont want to change
    that .EXE into a .DLL,let it be an executable. that executable is in running mode
    and through my java program i need to call a function in that EXE file.
    Is ther any way to do it?Nope, but you have another problem: why can't you separate your server program
    into a .dll part and a startup part? Both, when properly linked against each other
    should give you an executable file.
    kind regards,
    Jos

  • Report Builder: can i define a function in  the rdf file ?

    Hi All,
    About the report builder, can i define a function in the rdf file ? and then i want invoke it in the report SQL, just like :
    function Get_Ap_Prepay_Balance(p_Invoice_Id IN NUMBER, p_End_Date IN DATE) RETURN NUMBER IS
    l_Amount number;
    begin
    RETURN l_Amount;
    end;
    thanks.

    You can create functions in reports, but slightly different from doing it in PL/SQL
    function Get_Ap_Prepay_Balance return number is
    l_Amount number;
    begin
    assuming that you have invoice_id in your select statement and p_End_Date is a report parameter, you can refer to them in your function as :p_End_Date and :invoice_id
    for example select prepay_amount_remaining into l_Amount from ap_invoice_distributions where invoice_id = :invoice_id and accounting_date = :p_End_Date
    return(l_Amount);
    hope this helps

  • How to call a function in one .js file from another .js file

    Hello Techies,
    I am trying to call a function in two.js file from one.js file.
    Here is my code
    one.js
    <script>
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
         function one()
                        var a;
                       two(a);
              }two.js
                  function two(a)
                          alert("two");
                      }But the function two() is not working.
    How can I do this one??
    regards,
    Krish

    I think there is a syntax error in line
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
    end tag <\/script> is wrong.

  • Calling an external C function from a C file in JNI

    Hello,
    I am trying to call an external C function, from a C file which is being called by a Java file. I am getting an unresolved symbol error. I have tried many things like, making the external C function in the format of JNI, etc, etc. It is still not working. I think it has something to do with linking the two C files. If anyone can please answer this, it would greatly help me. here is the code:
    HelloWorld.c:
    #include <jni.h>
    #include <stdio.h>
    #include "MyOldHello.h"
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL
    Java_HelloWorld_print(JNIEnv *env, jobject obj)
         helloPrint();
         return;
    HelloWorld.java:
    class HelloWorld
         private native void print();
         public static void main(String[] args)
              new HelloWorld().print();
         static
              System.loadLibrary("HelloWorld");
              System.loadLibrary("MyOldHello");
    MyOldHello.c:
    #include <jni.h>
    #include <stdio.h>
    #include "MyOldHello.h"
    void helloPrint()
         printf("\nHello World!\n");
    MyOldHello.h:
    void helloPrint();
    Now i use the Visual C++ command prompt to compile this by saying:
    javac HelloWorld.java
    javah -jni HelloWorld
    cl -Ic:\Java\jdk1.6.0_20\include -Ic:\Java\jdk1.6.0_20\include\win32 -MD -LD HelloWorld.c -FeHelloWorld.dll
    and now it gives me the error saying that there is an unresolved external symbol, which is the call to helloPrint in the file HelloWorld.
    If anyone knows how to solve this, or how to call external C functions from a C file that is being called from a Java file using JNI, please respond.
    Thanks
    Nick

    Hi,
    In your post on velocity review, you did not compile MyOldHello.c. You compiled a C file that included the header file for it and called a method defined in the header. The linker is never going to be able to find the code for this if you do not include the object file for this.
    Try this. You will also have to add in any JNI libraries you need to link against but I am sure you could work that out.
    cl /c MyOldHello.c
    cl /c -Ic:\Java\jdk1.6.0_20\include -Ic:\Java\jdk1.6.0_20\include\win32 -MD HelloWorld.c
    cl /LD MyOldHello.obj HelloWorld.obj /FeHelloWorld.dll
    [http://msdn.microsoft.com/en-us/library/f35ctcxw(VS.80).aspx]
    Cheers,
    Shane

  • XI 3.0 Publisher Function: "Pachage as Zip File" causes random file name

    I found in XI 3.0 Publisher Function: "Pachage as Zip File" will lose control to each report's file name.
    That is: The zip file I name it to: Report-2008-08-08-22-45-20.zip
    In the zip: ~bcap_8d8553f0ca6b347942_1.xls; ~bcap_f94553f0ca6c247941_2.xls
    I tried to set default value in Destination Job Server's Option, still can not control the report's name in the zip.
    Any one can help? I don't think customer will accept to rename each report name in the zip file every time he receives email.
    Thanks in advance!
    Jennie

    thats the normal thing happen with all the business Objects ,
    when you export a report to the system it be exported to the repository and you will have no access to the physical storage, it managed automatic by the business objects CMS, which knows every report what and where, so it rename it to the random name as the CMS suggest
    even you use the publisher wizard it do the same, and also when save Webi Report, Deski Report and Crystal Reports
    all gets random names, and saved to the CMS file system and repository.
    good luck

  • Calling functions from a .JS file

    Good morning,
    I stored my Javascript functions in a .JS file and saved the file in the /i/javascript folder on my APEX server.
    In the HTML Header field I put the following code: <strong>&lt;script src="#IMAGE_PREFIX#javascript/P9001.js" type="text/javascript"&gt;&lt;/script&gt;</strong>.
    In the HTML Body Attribute field I put the following code: <strong>javascript: onLoad='P9001PageLoad()';</strong>
    When the page loads I get the error "<em>Object Expected</em>" on Line 21, Char 1. (When I view the source, line 21 is the line with the code from the HTML Body Attribute Field.)
    Also, in the source HTML of the page, line 17 has <strong>&lt;script src="/i/javascript/P9001.js" type="text/javascript"&gt;&lt;/script&gt;</strong> which I assume is how the APEX engine renders the code I typed into the HTML Header field, so I think that I typed it correctly.
    I am including the JS function that I am trying to call, but I do not believe there is a problem with the code. If I put the code into the Header Text Field then the function is called, and runs as expected. I beleive my issue has something to do with the JS files.
    function P9001PageLoad() {
    // Called on pageload to populate the Select Lists with the values in the
    // hidden fields. The Hidden fields are populated by P9001_PROC_PAGELOAD.
    var i = 1;
    var counter = 0;
    for (i=1;i&lt;=8;i++) {
    var slst_simp = document.getElementById("P9001_SLST_SIMPQS_Q" + i);
    var hidn_simp = document.getElementById("P9001_HIDN_SIMPQS_Q" + i);
    if (hidn_simp.value != parseInt(hidn_simp.value)) {
    slst_simp.value = null
    counter++
    else {
    slst_simp.value = hidn_simp.value
    if (counter &lt;8) {
    var i = 1;
    var counter = 0;
    for (i=1;i&lt;=8;i++) {
    var slst_simp = document.getElementById("P9001_SLST_SIMPQS_Q" + i);
    var hidn_simp = document.getElementById("P9001_HIDN_SIMPQS_Q" + i);
    if (hidn_simp.value != parseInt(hidn_simp.value)) {
    slst_simp.style.backgroundColor = "#dd0000"
    Any advice you can offer in helping me utilizing .JS files would be greatly appreciated! Thank you in advance.
    Donald Semensky.

    Hi,
    One other thing you should try - ensure that all command lines in the script end with ; eg:
    slst_simp.value = nullshould be:
    slst_simp.value = null;In some cases, this can actually cause errors further down in the code.
    You could simplify this test by creating a very small script:
    function test() {
    alert("Hello");
    }Run that in your onload and see if a message pops up. If it does, it means that your script contains errors that stops the script from being used and any call to it would return an invalid object type error message.
    Andy

  • Can Any one tell me what is the step in calling a function from a *.lib file in Labview application

    Hi, I am working on Labview 8.0.
    I am trying to  communicate to a thrid party HW using the driver file he has provided to me.
    The drive file is a *.lib file.
    I am unable to call the function from the lib file.
    I could get only from a DLL.
    Pls help .
    Regards
    -Patil

    patil wrote:
    When it is possible in Lab Windows, why calling a function from a static library is prohibited?
    I was trying to use Function node, but found that it is only for functions from a DLL file.
    Will CIN be useful.? 
    LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
    compiler. That's why you can call .lib files because that's how .lib
    files are used.
    A CIN, as pointed out, is something completely different and will not help you.  

  • How can I using functions implicit in dll file in java code ?

    How can I using functions implicit in dll file in java code ?
    I'm developing a program that interfacing with fingerprint hardware.
    I have the finger print already, and I have to the SDK that have all functions for managing this fingerprint.
    These SDK functions are represented in dll files.
    I want to know how can I use these functions in java code .
    I looked on this link of sun forums :
    http://forum.java.sun.com/thread.jspa?threadID=305171&messageID=1215613
    but I don't Understand the meaning of native code.
    Thanks for help.

    please please please please please please please please help me:
    After reading a lot of articles, tutorials, and overviews about JNI (Java Native Interface)
    I found that these steps
    1.     Develop the Java code
    2.     Compile the Java code to a class file
    3.     Generate the header file
    4.     Implement the native method
    5.     Create the shared library or DLL
    6.     Run the Java program
    Is the common steps in JNI development
    The most powerful link was
    http://java.sun.com/docs/books/jni/html/start.html
    and
    http://www.netbeans.org/kb/55/beginning-jni-part2.html
    and the pdf oh this link
    http://www.ibm.com/developerworks/edu/j-dw-javajni-i.html requiring IBM registration to download it.
    But I have already the DLL, and want to the stright forward way to use its functions by java code only.
    I don not to write any C++ code .
    Is this possible???????????????????????????????
    The name of these dll is �zkemsdk.dll�
    It developed by ZKSOFTWARE company for managing a finger print �NP1500A�of
    http://www.napcogulfsecurity.com/finger_print.asp
    thanks for help

  • Copy procedures, functions and packages to files

    Can anyone help me, how to put all procedures, functions and packages to files. It is important, that when procedure have name PROCEDURE_CREATE then file have PROCEDURE_CREATE.txt
    Is that possible?

    Hi,
    I guess you want following.
    Do:
      1  DECLARE
      2   CURSOR Cur_All IS SELECT DISTINCT NAME
      3                   FROM ALL_SOURCE
      4                              WHERE ROWNUM <= 10 ;
      5           --        WHERE OWNER LIKE 'KIN%' ;
      6   v_Name ALL_SOURCE.NAME%TYPE ;
      7  BEGIN
      8   OPEN Cur_All ;
      9   LOOP
    10    FETCH Cur_All INTO v_Name ;
    11    EXIT WHEN Cur_All%NOTFOUND;
    12    DBMS_OUTPUT.PUT_LINE('SPOOL '||v_Name||'.txt') ;
    13    DBMS_OUTPUT.PUT_LINE('SELECT TEXT FROM ALL_SOURCE WHERE NAME ='''||v_Name||''' ORDER BY LINE ;') ;
    14    DBMS_OUTPUT.PUT_LINE('SPOOL OFF') ;
    15   END LOOP;
    16   CLOSE Cur_All;
    17* END ;
    SQL> /
    SPOOL STANDARD.txt
    SELECT TEXT FROM ALL_SOURCE WHERE NAME ='STANDARD' ORDER BY LINE ;
    SPOOL OFF
    PL/SQL procedure successfully completed.
    SQL> Do spool of the above anonymous block. And run it as a SQL script. You will get required output.
    Regards,
    Arpit
    Message was edited by:
    arpit_shah4u

  • Paste the link function in a pdf file in the preview is missing?

    Paste the link function in a pdf file in the preview is missing? Please insert again, in Lion he was still there, please help me

    Don't think so. If it is it would be in the metadata for the PDF -- ctrl D and select the left most tab. There should be a button for additional data if you want to explore.

Maybe you are looking for

  • Imac freezes in sleep mode

    Ever since installing Lion my Imac freezes when in sleep mode. Has anyone had the same problem and been able to fix it

  • SQLLDR -- WHEN works only for the first INTO table

    I tries to load 2 table from one data file. SQLloader loads only the first table in the control file. If I switch the INTO sequence it then load the other table that now its the first in the control file. It works fine if I split the control into 2 c

  • Date transfer between 11g BPMN Process and Human Workflow task

    I'm creating a small BPMN process in SOA Suite 11g. Pretty simple: Holiday Request where one enters name, start date, end date and leave type (e.g. annual). The odd thing is, any dates I enter into the process end up losing one day when viewed in the

  • I've lost my "coreservices/installer.app" - Mavericks - where can I get a download of it?

    I haven't a clue as to why it isn't in the library/coreservices folder but it isn't Therefore, when I try to install a .pkg it defaults to textedit ! Thanks, BJ

  • Corruption of TM files on TC?

    I have a MBA and a MBP2 running TM accessing the appropriate image files on a TC. I've now had the MBA's back up image file corrupted three times while the MBP2's has been corrupted once. Disk Utility app cannot handle the file corruptions. And, of c