Problem in Retrive values from result set

I have a class where i do all database operation .First i fire select query and take values from result set and based on that value i fire update query.
Problem is that i am not getting all values from result set . i get only last value and when i fire update query i get error as :Resultset is closed.
I am using acess and java.

You probably are using the same Statement object for both queries? Try creating separate Statement objects for each query. (My guess is this a problem with the way you're using JDBC, not a Servlet issue.)

Similar Messages

  • Transfer data from Result Set (Execute SQL Task) into Flat File

    Hi to all,
    My problem is this:
     -) I have a stored procedure which use a temporary table in join with another "real" table in select statement. In particular the stored procedure look like this:
    create table #tmp
    col1 varchar(20),
    col2 varchar(50)
    --PUT SOME VALUE IN #TMP
    insert into #tmp
    values ('abc','xyz')
    --SELECT SOME VALUE
    select rt.*
    from realTable rt, #tmp
    where rt.col1 = #tmp.col1
    -) I cannot modify the stored procedure because I'm not admin of database.
    -) I HAVE THE REQUIREMENT OF TRANSFER DATA OF SELECT STATEMENT OF SOTRED PROCEDURE INTO FLAT FILE
    -) THE PROBLEM is that if I use an OLEDB source Task within a Data Flow Task I'm not be able of mapping column from OLEDB source to flat file destination. The reason for this, is that in the "Column page" of OLEDB source task, SSIS do not retrieves
    any column when we using a temporary table. The reason for this, is that SSIS is not be able to retrieve metadata related to temporary table. 
    -) One possible solution to this problem is to use an Execute SQL Task to invoke the stored procedure, store the result returned from stored procedure in a Result Set through a Object type user variable.
    -) The problem now is: How to transfer data from result set to flat file?
    -) Reading here on this forum the solution look be like to use a Script task to transfer data from result set to flat file.
    QUESTIONS: How to transfer data from result set to flat file using a script task?? (I'm not an expert of vb .net) Is it really possible?? P.S.: The number of row returned of stored procedure is very high!
    thanks in advance.

    Hi  Visakh16<abbr
    class="affil"></abbr>
    thanks for the response.
    Your is a good Idea, but I do not have permission to use DDL statement on the database in production environment.

  • Facing Problem with passing Values from One report to another

    Hi,
    I am Hemanth, I have developed 2 reports. Firast Report High Level Summary, Secong is detailed. First report is developed using Union(4 union) , I am having 4 columns. The report is generating the data. I have used Navigation option on Client Column to move on to Second report. In Second report with in Filter i am using Prompted option. Due to some problem, the client value from first report is not passing to the second one. The second report is getting generated for all the clients.
    Normally i have used this Navigate option in other reports and that works fine. I have even tested with Union, it works. This time it is giving some trouble.
    Please, let me know whats going wrong.
    Thanks for the help.

    sorry for the late updation.
    My First Report, Summary level is a Pivot Table.
    I tried the same report with Table option, the value is passing correctly.
    Is there a way to get rid of this situation using Pivot table.
    Thanks for your help.
    below is the original request.
    Hi,
    I am Hemanth, I have developed 2 reports. Firast Report High Level Summary, Secong is detailed. First report is developed using Union(4 union) , I am having 4 columns. The report is generating the data. I have used Navigation option on Client Column to move on to Second report. In Second report with in Filter i am using Prompted option. Due to some problem, the client value from first report is not passing to the second one. The second report is getting generated for all the clients.
    Normally i have used this Navigate option in other reports and that works fine. I have even tested with Union, it works. This time it is giving some trouble.
    Please, let me know whats going wrong.
    Thanks for the help.

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Getting every odd-numbered row from result set

    select *
    from mytable
    where MOD(rownum,2) = 1;
    Why does this not give me every odd-numbered row from result set? It returns just 1 row....
    Thank u

    When you say MOD(ROWNUM,2)=1 it will list only the first row with rowid which is devisible by 2 and gives a reminder 1.
    Just tweak your query with a GROUP BY:
    SQL> select rownum from your_table group by rownum having mod(rownum,2) =1;
        ROWNUM
             1
             3
             5
             7
             9
            11
            13
            15
            17
            19
            21
        ROWNUM
            23
            25
            27
            29
            31
            33
            35
            37
            39
            41
            43
    etc...
    [pre]
    Jithendra                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem reading RFC values from IRecordSet !!!!

    Hi All,
    I am having some problem reading values from IRecordSet. Can not seem to parse the output structure from RFC. AM using connector gateway service to execute BAPI_EXCHRATE_GETCURRENTRATES.
    Here is the code,
    MappedRecord input = rf.createMappedRecord("input");
    input.put("DATE",new String("01011990"));
    input.put("DATE_TYPE", new String("V"));
    input.put("RATE_TYPE", new String("M"));
    MappedRecord output = (MappedRecord) ix.execute(ixspec, input);
    Object rs = null;
    IRecordSet recSet = null;
    Object result = output.get("EXCH_RATE_LIST");
    if (result == null) {
    response.write("<BR>null");
    rs = new String(" ");
    } else if (result instanceof IRecordSet) {
    IRecordSet irs = (IRecordSet) result;
    response.write("<BR>Got some dataaa");
    IRecordMetaData rsmd = null;
    rsmd = irs.retrieveMetaData();
    irs.beforeFirst();
    while(irs.next()){
    response.write("Row::"+irs.getString("RATE_TYPE")+" "+irs.getString("FROM_CURR")+" "+irs.getString("EXCH_RATE"));
    Am getting the pritn statement, Got Some Data on the PDK component.
    But somehow not able to read the values from IRecordSet
    What is the mistake here?
    Pls help
    Edited by: Aakash Jain on Oct 11, 2008 12:22 AM

    Hi
    Try in this way.
    IRecordSet resultTable = (IRecordSet)outputParams.get("TABLE_NAME");
    for(resultTable.beforeFirst(); resultTable.next(); ) {
    response.write(resultTable.getString(0));
    response.write(resultTable.getString(1));
    Thanks

  • Custom Rule - Problem in passin values From Rule Container to WF Container?

    Hi Guys,
    I am having hard time passing values back from my custom rule. I have created a custom rule to determine the agents in PFAC which takes in the Person number as import element of container. It determines the Manager as agent and I am passing Managers Person Number back to workflow. If he dont approve the Request then it will be passed to his boss. In this case I will pass this imported Mangers Person number back to rule so that his boss will be determined as agent. I  have created ZRULE function module. I am passing value back from Rule container to Workflow Container using following code.
    swc_set_element ac_container 'SUPERPERNR'  lf_super_pernr.
    I have created a element SUPERPERNR on rule container and workflow container as well .The problem is in the Rule container I am not able to create SUPERPERNR as export parameter. The tick mark is grayed out and there is no option for setting it as export.
    My question is do I have create a Export element on Rule container or Not? If i just write the code
    ( swc_set_element ac_container 'SUPERPERNR'  lf_super_pernr ) will it set the value in WF container? In my case it is not setting. I have to bind the values from rule container to WF container and if My rule container element is not allowing me to click the tick mark as export how can i pass value of of rule container back to WF Container?
    Please help me guys.
    Thanks,
    Manish.

    Hi Manish,
         Same scenario I have developed in my system. This all steps I did in my system.
    1) Created a Z function module which takes import parameter (Parameter name = 'EMP') in the
        format 'US100123'.
    2) This in turn fetches back the supevisor or boss as an export parameter (Parameter name = 'BOSS') in
         the format 'US100245'.
    3) This function module is attached to a BUS object(SWO1).
    4) While attaching this function module to BUS object you need not do any manual coding it is done
        automatically.
    5) Implement, release and generate this BUS object.
    6) Create a new variable in your workflow (Parameter name = 'ZSUPERVISOR') for storing the value
        which is returned by the Z method.
    7) Create a new task.
    8) Put in your BUS object name, then your Z method name, select background processing checkbox.
    9) Press save, it will ask for transfer of missing elements, select yes.
    10) Then you will see a green button below your Z method name click on it.
    11) Top portion contains your Z method variables, below to it you have the import parameter window in
          this window you should have &EMP& -> &EMP&., below to import parameter window you have
          export parameter window in this window you should have &BOSS& <- &BOSS&. (This is method
          binding).
    12) Now click on enter button then click on back button it will generate the task binding automatically
         just press yes.
    13) Now click on binding exist button.
    14) Here you have the Workflow container variables as well as the system container variables.
    15) In the import parameter window left portion is for your workflow variables and right portion is for your 
          method variables. In my case i had sent workflow initiator and fetched his supervisor. The Import
          parameter binding was &WF_INTIATOR& -> &EMP&. and the export parameter binding part was
          &ZSUPERVISOR& <- &BOSS&.
    16) Save the task and run the workflow.
    Regards.
    Vaibhav Patil.

  • Getting the record count from result set

    i'm retreiving the result set using the executeQuery method, now i want to know how many records are there in the result set, that is the record count of the result set.
    one solution to that is to first use the executeUpdate and then use the executeQuery but i think that is not the right way.
    so please tell me is there any method in jdbc to get that thing done
    Tanx

    Hi
    Do you know if your DB supports "insensitive scrolling"?
    SQL generally do, but some don't - I had the same problem with the
    open source version of Interbase from Phoenix...
    Anyway - try creating your statement this way:
    public Statement createStatement(int resultSetType, int resultSetConcurrency)
    throws SQLException
    ...where resultset type should be:
    ResultSet.TYPE_SCROLL_INSENSITIVE
    Then you can do this:
    ResultSet rs = stm.executeQuery(q);
    int size = rs.last(); //this what you looking for?
    rs.beforeFirst();
    while(rs.next()){
    }

  • The problem of return value from a method

    Hi everyone:
    I want return a value from following method. The basic idea is that I want use Num as a parameter to get a value from a field, therefore I can input this value into another database for the display purpose by using other classes. However I got error message when I compiled it.
    "method does not return a value"
    I know it is a problem, but how I can fix it? I need your help. Thanks in advance.
    Dawei
    Method:
    public int Read(int Num) {
    try{
    String qr1 = "select Record form Buffer where Record="+Num+"";
    ResultSet rs = statement.executeQuery(qr1);
    while (!rs.next()){
              int result=rs.getInt(1);
    return(result);
         catch (SQLException e){
                   System.err.println("Error in inserting into database " + e);
                        System.exit(1);
    return 1;

    "select Record form Buffer ...Hopefully "form" is actually "from" in your code.
    You have three points of exit from your routine, and only two return value statements.
    1 -Return inside the while loop has a value.
    2- Return inside the exception block (not sure that '1' would be a valid number)
    3- The very end of the method, just before the last '}' does not have a return statement.
    By the way, this question has nothing to do with JDBC, so another forum might be a better place to post it.

  • Eliminating null from result set

    Hi,
    How can i set some value (say 0) for fields having null value using ejbql?
    Anybody please help me....
    Thanks in Advance,
    Anish.

    what is the best way to get from a jdbc Result Set to
    a Swing Table Model?I think I would iterate over all the elements in my result set and add them to a hashmap / hashtable where the key is their spot in the table, represented by a Point object. One thing I'm not sure of is if 2 points with equal coordinates have the same hash value, but you could always just create your own point class where such is the case and use that.
    Result Sets are no random access structures. You have
    to navigate through them to reach a certain row.Yes. Not only that, but the resultset is part of your transaction with the DB. It's not good style to keep that open any longer than necessary.
    JTable Models want you to implement something like
    getValueAt(int i, int j) to access a row (and even a
    column) at random.Would be easy using my suggestion above
    - your are in fact interducing another cashKind of. But you don't have a choice. You gotta copy the data.
    - big Result Sets could be a problemThat's always going to be true, and I don't see how you can get around it.

  • Problems getting selected values from HtmlSelectManyCheckbox

    Hello,
    I am having problems getting values via getSelectedValues() from my HtmlSelectManyCheckbox component. The method returns an object array but the values are the same as the initial selectItems property.
    JSP:
    <h:selectManyCheckbox id="checkBox"
        binding="#{userEditBean.manyCheckbox}"
        value="#{userEditBean.groupIds}"
        layout="pageDirection">
      <f:selectItems value="#{userEditBean.allGroups}"/>
    </h:selectManyCheckbox>
    <h:commandButton action="#{userEditBean.ok}"     value="OK"/>Bean:
    public class UserEditBean extends BaseBean {
        private HtmlSelectManyCheckbox manyCheckbox = new HtmlSelectManyCheckbox();
        private String[] groupIds= {};
        private List allGroups = new ArrayList();
        public String[] getGroupIds() {
                groupIds= backing.getSomeIds();
                return groupIds;
        public void setGroupIds(String[] ids) {
            this.groupIds= ids;
        public HtmlSelectManyCheckbox getManyCheckbox() {
            return manyCheckbox;
        public void setManyCheckbox(HtmlSelectManyCheckbox newC) {
            this.manyCheckbox = newC;
        public List getAllGroups() {
            allGroups = backing.getAllGroups();
            return allGroups;
        public void setAllGroups(List newList) {
            this.allGroups = newList;
        public String ok() {
            Object o = manyCheckbox.getSelectedValues();
        }The problem is, the getSelectedValues() returns the values from the initial state of the page. The is no mark of the changes made by the user. Any help will be appreciated
    Thanks,
    Matek

    Your approach is somewhat odd. The selected values are just reflected in the groupIds, but you're overridding it with backing.getSomeIds() each time when the getter is called.
    Here is a basic working example:<h:selectManyCheckbox value="#{myBean.selectedItems}">
        <f:selectItems value="#{myBean.selectItems}"/>
    </h:selectManyCheckbox>
    <h:commandButton value="submit" action="#{myBean.action}" />MyBeanprivate List<String> selectedItems;
    private List<SelectItem> selectItems;
    // + getters + setters
    // You can use initialization block or constructor to prepopulate the selectItems.
        selectItems = new ArrayList<SelectItem>();
    //or
    public MyBean() {
        selectItems = new ArrayList<SelectItem>();
    public void action() {
        // The selected items are reflected in selectedItems.
        for (String selectedItem : selectedItems) {
            System.out.println(selectedItem);
    }

  • Problem regarding accessing values from IBM Tivoli Directory Server

    hi,
    I am able to retrieve the values from ITDS.
    But the problem is when retrieving userPassword attribute value.
    Actually when i enter the userid and password in an html page and try to retrieve the corresponding user information from ITDS then it gives me exception
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.NullPointerException
         org.apache.jsp.Report_jsp._jspService(Report_jsp.java:74)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    note The full stack trace of the root cause is available in the Tomcat logs.
    While it is working fine for other attributes like mail etc.
    Is it somewhat related to encryption of password.
    How can it be solved?
    Thanks

    Hi!
    pls see http://help.sap.com/saphelp_nw70/helpdata/EN/44/0761cea5c610b3e10000000a11466f/frameset.htm
    if the users shall be created in the LDAP directory the UME datasource configuration has to be read/write.
    Regards
    Michael

  • JCo's StatefulServerExample problem (returning a value from RFC call?)

    Hi,
    I'm using JCo3 and want to run StatefulServerExample sample program. I've created the ABAP-side code according to JCo's docs (2 wrappers and report ZJCO_STATEFUL_COUNTER). I'm connecting to SAP CRM. I've successfully runned all other sample programs.
    I've got a problem with receiving data from the JCo server to CRM report. The error is reported on the SAP's side:
    error:          CALL_FUNCTION_WRONG_VALUE_LENG
    description:    Incorrect field length for 'Remote Function Call'.
    error analysis:
    A data error occured when executing a Remote Function Call
    The length of one of the fields is incorrect.
    Length of source field... 1
    Length of target field .. 4
    Data type of field....... 8
    (Data type 0=C, 1=D, 2=P, 3=T, 4=X, 6=N, 7=F, 8=I)
    error is triggered by the call to 'Z_GET_COUNTER' (see code below).
    There is no problem with preceding calls to JCo server which do not return anything.
    I would appreciate any help with this problem!
    Piotr
    Problematic report code:
    *& Report  ZJCO_STATEFUL_COUNTER
    REPORT  ZJCO_STATEFUL_COUNTER.
    PARAMETER dest TYPE RFCDEST.
    DATA value TYPE I.
    DATA loops TYPE i VALUE 5.
    DO loops TIMES.
      CALL FUNCTION 'Z_INCREMENT_COUNTER' DESTINATION dest.
    ENDDO.
    CALL FUNCTION 'Z_GET_COUNTER' DESTINATION dest
      IMPORTING
        GET_VALUE = value.
    IF value <> loops.
      write: / 'Error expecting ', loops, ', but get ', value,
      ' as counter value'.
    ELSE.
      write: / 'success'.
    ENDIF.

    It seems to me that the ABAP code in the example is wrong - it should be INT1 instead of i:
    DATA value TYPE INT1.
    Now it works.

  • Retrieveing a value from a set of instances of same entity.

    Hi,
    I want to retrieve a value of a particluar attribute from an entity instance among the group of instances of same entity. How this can be done?
    Consider my rule base as below
    the person ---> the person's income year (the person's income years)
    the person's income year --> the person's income months(the person's incomes in a year)
    "the person" conatins info about the person, "the person's income year" contains information about the year and "the person's income months"
    entity contains entity instances for various months like jan- $200, feb-$300 and so on for a particular year defined in the "person's income
    year" entity.
    Now consider below set of data
    Person 1
    year-2012 - entity instance
           jan -$200 - entity instance
           feb-$300 - entity instance
           mar-$400 - entity instance
    year-2013 - entity instance
           jan- $500 - entity instance
           feb- $700 - entity instance    
           mar-$100 -entity instance
    Now I im proving rules for year 2013 say jan , and I want to get the value of an attribute from the entity of year 2012  jan month.
    How can I get the value from a previous entity instance?

    You can use InstanceValueIf to achieve the result

  • How urgent:how can we know the size of a record from result set

    hi proffesionals i attend on problum with arrangment,for that what i am doing is i am fetching datas from database and printing in a row vertically.it is not looking good.i want to print it horizontaly like
    ae00023 as3333 a6556 a457864 a6576
    ae00025 as3336 a6556 a457866 a6578
    i wrote the coding like
    <%while(resultsetdisplay.next())
    {%>
    // try to print the datas in horizontal way
    <tr>
         for (int i=index;i<resultsetdisplay.getFetchSize()-10;i--)
    <td class=display><%=resultsetdisplay.getObject(4)%></td>
              int i=index;
    </tr>
    <%}%>
    is it prints horizontaly.
    help me soon

    Hi
    You can the Meta Data for the result set and then get the getColumnCount() from the MataData to get the number of columns in the resultset.
    Bye

Maybe you are looking for

  • Upload file without user intervention

    I know that there's been some topics like this before but I have more trouble. My goal is this: I file should be automaticly uploaded to my servlet and the I want the internet browser to handle the response. Because of the restrictions that lies, I t

  • Can iPad mini 2 show flash photo galleries (Lightroom)?

    Adobe Lightroom can create flash galleries with advanced navigation and automatic slideshows. HTML doesn't support that. I'm afraid any apple product won't show those galleries in safari. Or am I wrong? How can I create a slideshow with captions for

  • Blog page issues in IE

    I'm using iWeb and .mac to create a video game website. I put the game reviews and description on my blog pages. Recently people have informed me that they can only see half of my review page when using Internet Explorer. I have tried 3 different PCs

  • "Error: An error occured deleting the import map"

    Hello, When trying to delete imported data, I get the following message : Error: An error occured deleting the import map Detail: Data access error And the imported data aren't deleted. The loaded file has around 350000 rows for 12 dimensions. I neve

  • WebService Call Fails for Communication Users

    Hi I am calling a BAPI through web service in VB.NET windows application. The application works fine with Dialog users but when I use Communication User then it thows this message. The Request Failed with HTTP Status 401: Unauthorized Where as if i c