How to pass a Connection variable from a servlet to a class?

Good day!
I have a class named ExecQuery for executing an sql query. This class accepts an sql statement and a Connection variable as its parameters. It has a method to return the resultset. Then, I also have a servlet that establishes the connection in the init method and instantiates the ExecQuery. The problem is that the Connection variable becomes null in the ExecQuery class that receives it. Why is this so? Please let me know why the Connection variable becomes null and the solution for this.
Your help would be very much appreciated. Thanks so much.

Hi,
As such it cant become null. Make sure null value doesnt get passed to ExecQuery class.
Anyway, better idea would be getting Connection in ExecQeury class rather that Servlet.

Similar Messages

  • How to pass a form variable from page to page

    I have a series of 4 forms on 4 pages that update a database.
    A variable from one of the forms (doesn't matter which one, if it's
    easier one way over another, let's go that way) is passed to the
    last page, where a PayPal button will appear based on the value of
    the form variable. I am using ASP javascript and an Access
    database.
    Thanks.

    jennivazquez wrote:
    > I have a series of 4 forms on 4 pages that update a
    database. A variable from
    > one of the forms (doesn't matter which one, if it's
    easier one way over
    > another, let's go that way) is passed to the last page,
    where a PayPal button
    > will appear based on the value of the form variable. I
    am using ASP javascript
    > and an Access database.
    Either store the variable in a hidden field in the
    intermediate forms,
    or use a session variable.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to pass a bind variable from one SQL Report to Another

    Hello~
    I've created a link on one SQL Report page (Page 1). I would like a value from Page 1 used in the SQL on Page 2 to determine the result set. The Where Clause in SQL Query containing the bind variable is as follows:
    AND hp.party_name     = ':District_Account'
    When I run Page 1 and click on the link to execute Page 2, I get 'No Data Found'. The setup of the link is as follows:
    Column_Name = District_Account
    Link Text = #District_Account#
    Target = Page in this application
    Page = 2
    I'm a rookie working in V1.6...any help would be greatly appreciated!
    Thanks,
    Becky

    I don't see any parameter being passed in that URL. A little sample: http://htmldb.oracle.com/pls/otn/f?p=33203:4<br>
    when you click on the edit link the URL looks like this:<br>http://htmldb.oracle.com/pls/otn/f?p=33203:5:16073998852455071705::NO:5:P5_TABLE_NAME,P5_OWNER:PRESIDENTS_THEMES%2CBLUETEST<br><br>
    where P5_TABLE_NAME and P5_OWNER are the items and PRESIDENTS_THEMES and CBLUETEST are the values.<br><br>
    The SQL on the filtered report looks like:<br>
    SELECT *
    FROM all_tab_cols
    WHERE table_name = :P5_TABLE_NAME
      AND owner = :P5_OWNER<BR><BR>

  • How to pass the USER variable to RPD in 11g?

    I am trying to figure out how to pass the USER variable to the RPD in 11g.
    In 10g, I had define an intializtion block to store the USER variable and pass it to a statement that has to be executed before the query is executed.
    We use the Oracle VPD technology that allows to restrict data access. This is the statement that has to be executed before a query can run.
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER(:USER))) from dual
    That is the 10g version and it works fine.
    In 11g, I tried to use
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER('VALUEOF(NQ_SESSION.USER)')) from dual
    but this is not working.
    Any help?

    any ideas?

  • How to passing value into Captivate from html?

    How to passing value into Captivate from html?
    Or
    How to communicate between objects in one slides?

    Hi czhao0378 and welcome to the forums!
    Captivate does not natively allow you to communicate your own
    data, either internally or externally. The only way to make this
    happen is to create your own functionality, either via custom-built
    Flash objects or JavaScript code executed in the browser or a
    combination of both.
    The only example I've seen of any "data passing" inside
    Captivate is a custom text input/output solution that was posted on
    the Captivate Developer Exchange:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1253 021
    This solution consists of an input box that takes information
    from the user on one slide and a second box that displays that
    information on another slide. The functionality was built in Flash
    and is embedded in Captivate as a Flash "animation". Unfortunately,
    since this is a custom functionality, the information is not
    included in the user completion results Captivate can pass to a
    Learning Management System.
    Since the solution mentioned above relies on a Flash
    Actionscript variable to hold the information that is displayed,
    you can also pass the information from HTML to Captivate using the
    "SetVariable" command in JavaScript. This would at least allow you
    to display your own HTML-based data inside Captivate.
    Beyond that, I'm not aware of any other way to gather and
    pass data in Captivate.

  • Scripting - Passing and Enterprise variable from script to script

    Hello all,
    We are using UCCX 7.0_SR5
    I am looking to be able to pass a captured variable from one script to another.
    We use a message in queue where a caller waiting in queue can choose to leave a message and then that message is queued back into the sytem for the next available agent. When that agent recieves the message in queue they basically call back out to the customer leaving the message.
    We capture a variable in the first script when they decide to leave a message. The variable holds the call back number that they enter into the system. There is a second script that presents these message in queue calls to the agents. We would like to pass that variable that holds the number enterend by the customer to the second script so that that number appears on CAD in the enterprise data fields. The reason behind this is so the agent has a number to call back in the event they don't reach anyone when the system calls back out and the message left by the customer does not contain a call back number.
    How can I pass that variable from one script to another so it can be presented in CAD for the agents?
    Thanks for any help and let me know if you need any further information.

    You would use a "Get Call Contact Info" step to set your callerID variable, where the "Calling Number" attribute is set to your callerID variable.

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to pass a jsp variable into javascript??

    <p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <p><html>
    <p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
    <p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
    <p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
    <p>Time until next game
    <p><c:forEach var="tuple" items="${tuples}">
    <p><c:if test="${fn:contains(tuple, 'row ')}">
    <p> <p><code>
    <p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
    <p> <font color="blue">
    <p> <c:out value="${values[17]}" />
    <p><c:set var="remainingtime" value="${values[17]}" />
    <p> </font>
    <p> </code>
    <p></c:if>
    <p></c:forEach>
    <p><form name="counter"><input type="text" size="8" name="d2"></form>
    <p><script>
    <p>var milisec=0
    <p>var seconds=eval("document.myForm.remaining").value;
    <p>function display(){
    <p> if (milisec<=0){
    <p> milisec=9
    <p> seconds-=1
    <p>}
    <p>if (seconds<=-1){
    <p> milisec=0
    <p> seconds+=1
    <p> }
    <br>else
    <p> milisec-=1
    <p> document.counter.d2.value=seconds+"."+milisec
    setTimeout("display()",100)
    <p>}
    <p>display()
    <p></script>
    <p></body>
    <p></html>
    <p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001

    Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
    <html>
    <body>
    <form name=f>
    <%!
    String str = "A String"
    %>
    <script>
    var avariable = <%=str%>
    <script>
    </form>
    </body>
    </html>
    Let me know if you face any problem

  • How to pass parameter /1BCDWB/DOCPARAMS from webdynpro?

    Hi Experts,
    We create a wdp view and indert an adobe form into it. And this form has an interface based on XML schema.
    Now we want to translate this form into multi-language, and in wdp side, we will display diffenent language version of form for different regions.
    I found that there is a paramater /1BCDWB/DOCPARAMS-LANGU, and it seems can control the language version in processing.
    But I donot know how to pass parameter /1BCDWB/DOCPARAMS from wdp to adobe form.
    Its my 1st to use adobe form and wdp, i really have no way out. Any advice will be Appreciated.
    Thank you.
    Richard

    @sahai: Hey no , I am using very very simple example without any query or complex statement. I just have 2 radio buttons in VIEW1. On clicking the radio button, the naviagtion to view2 is done and the value of selected radio button is passed as a parameter in the plug.
    In the view2 , i just have a caption in my layout where i am displaying the parameter value by setting the attribute.THe warning i get is in view2. Here is the code. Apart from this there is no coding in view2.
    METHOD HANDLEPLUG_IN_V2 .
        DATA:
          NODE_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_NODE,
          ELEM_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_ELEMENT,
          STRU_CAPT_MSG                       TYPE IF_VIEW2=>ELEMENT_CAPT_MSG ,
          ITEM_MSG                            LIKE STRU_CAPT_MSG-MSG.
    *   navigate from <CONTEXT> to <CAPT_MSG> via lead selection
        NODE_CAPT_MSG = WD_CONTEXT->GET_CHILD_NODE( NAME = `CAPT_MSG` ).
    *   get single attribute
        NODE_CAPT_MSG->SET_ATTRIBUTE(
          EXPORTING
            NAME =  `MSG`
            VALUE = PAR_1 ).
    ENDMETHOD.

  • How can I access JSP variables from a JavaScript function in a JSP page?

    Respected sir
    How can I access JSP variables from a JavaScript function in a JSP page?
    Thanx

    You may be get some help from the code below.
    <%
        String str="str";
    %>
    <script>
        function accessVar(){
           var varStr='<%=str%>';
           alert(varStr);// here will diplay 'str'
    </script>

  • How to pass PO customer fields from ECC to SUS ?

    Hi Gurus,
    We defined a customer PO field at ECC side and want to pass it to SUS and diaplay it in SUS PO, my question is, how to pass PO customer fields from ECC to SUS?
    Please advise.
    Thanks and best regards
    jack

    Hi jackytam  ,
    /people/yeusheng.teo/blog/2008/01/05/ordering-unit-vs-order-pricing-unit-in-srm-sus
    you make get some pointers
    regards,
    Neelima

  • How to get an environment variable from OS in class ?

    Hello,
    How to get an environment variable from OS in class ?
    Thanks !

    An example of a Java application that does this is Ant, when you add a line like this in your build.xml:
    <!-- Import environment variables -->
    <property environment="env"/>
    I have looked at the source code of Ant 1.3, especially the file src/main/org/apache/tools/ant/taskdefs/Execute.java. Look at the methods getProcEnvironment() and getProcEnvCommand(). Ant uses an OS-dependent trick to get the environment variables.
    You can download the Ant source code from http://jakarta.apache.org/ant
    Jesper

  • How to Create an XML document from XSQL servlet which follows a particular DTD struct

    how to Create an XML document from XSQL servlet which follows a particular DTD structure.Could anyone send me a sample code for this.

    You'll need to associate an XSLT transformation with your XSQL page that transforms the canonical result into your DTD-valid format.
    For example, given an XSQL page like:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="rss.xsl" ?>
    <xsql:query max-rows="3" connection="demo" xmlns:xsql="urn:oracle-xsql">
    select title,id,description,url,to_char(timestamp,'Mon DD') timestamp
    from site_entry
    order by id desc
    </xsql:query>and an "rss.xsl" stylesheet that looks like this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" doctype-system="rss-0.91.dtd"/>
    <xsl:template match="/">
    <xsl:for-each select="ROWSET/ROW">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    <xsl:for-each select="ITEM">
    <item>
    <title><xsl:value-of select="TITLE"/></title>
    <link><xsl:value-of select="URL"/></link>
    <description><xsl:value-of select="DESCRIPTION"/></description>
    </item>
    </xsl:for-each>
    </channel>
    </rss>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>You produce DTD-valid output against the rss-0.91.dtd DTD that looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE rss SYSTEM "rss-0.91.dtd">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>

  • How do I Display a string from a servlet into a JSP Page???? NEED HELP!!!!

    Hi guys,
    How do I Display a string from a servlet into a JSP Page...
    Ive tried so many bloody things!.....
    Simply.
    I get text from JSP. The servlet does what ever it does to the string.
    Now. Ive create sessions and bean things,.... how the hell do I display it in a text box... I can display on the screen.. but not in the text box.!!!
    please help!!!

    hmmm, I dont really like using JSP programming, u should be using JAVA..
    the way to do it is:
    Call and cast to the bean like this:
    <%@ page import="beans.*" %>
    <% //cast to bean get request create object
    userNameBean u= (userNameBean) request.getSession().getAttribute("userNameBean");
    then... all you do is call it like this:
    <input type="text" name="firstName" value="<%= u != null? u.getFirstName(): "" %>">
    this is the real programmers way,,,
    chet.~

Maybe you are looking for

  • Firefox homepage button opens new window instead of new tab

    When I hit the homepage button on the Firefox toolbar, it now opens a whole new window instead of a new tab. It used to work until I upgraded to Firefox 9. Any suggestions as to how to fix this?

  • ADF UIX Search Form - Is this a bug?

    I created a JDev 9.0.5.2 ADF UIX Search form from the component palette. I ran the page without making any changes. I chose the Find button which displayed the search criteria. I selected the delete button and then the create button, which created 2

  • Result cache not working?

    Hi, BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for Linux: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production SQL> show

  • Organisational structure in ESS

    Hi all, In output of who's who search, when organization unit is clicked, it represents the entire org structure. This should not happen this way as it should show only one level up and lower levels of employee searched on.Please help me to resolve t

  • Mail won't launch after 10.4.7 update

    Clicking on it doesn't do anything. It says it was launched, but it must be exiting right away.