Whether we can store integer in a result set object

i am learning java. help me out in this regard

Dear friend ! Can you be more specific with the problem you encountered ?
Cheera

Similar Messages

  • Can we Save BQY without result set/data through dashboard script

    Hi All,
    Can we save a BQY without result set/data through dashboard script?
    Thanks,
    Soumitra

    Hi Soumitra,
    Its happy that you resolved it by yourself. But if you post your solution here then it will be helpful for everyone else looking for the same solution.
    Thanks,
    karthick

  • IPhone confusion over whether I can store music  on two or more computers?

    Hi,
    I have an iPhone and the music+videos are all on my computer at home.
    I would like the ability to play back using a laptop at work.
    I work in two locations and have access to two laptops, and there are discussions about me travelling to regional offices and to use the computers there.
    1.
    What options are open to me if I want to play back video from my iPhone in say 3 or 4 locations?
    2.
    What options are open to me if I want to put an additional track on my iPhone while I am at a regional office?
    3.
    Will that erase all my files and how can it be added to the Library?
    Thanks

    1) You can watch on your iphone or buy cables to watch via television.
    2) You can add the track, but erase all of the current music. Iphone will sync itunes content to ONE computer at a time.
    3) Yes it will erase the current itunes content.

  • 3 relatively identical queries.  Can we reuse the intial result set.

    I have a report... It has 3 queries.. These queries are basically the same except the group by differ in columns. Each query basically rolls up data into higher level aggragates. The underlying returned record set is the same, just a different group by in each query. Is there a way to get the record set once and reuse it in each query so that I dont have to perform the exact same underlying query over again? I ask because these queries can return 100,000 thousads of rows. There is also a dblink in between the query and the data. I know I can make sql records and use the table() command on a collection of sql records. Is that the only way to do something like that? Would that be efficient? Is there a way to give the result a name and then tell the subsequent queries to reuse the result associated with the name? It just seems very wastefull to perform the same query three times when I could do it once and reuse it.

    relatively identicalJust a though, two query are identicals, or are not identical.
    If I well understand, you need to aggregate differently the queries results, right ? That means, not only the GROUP BY are differents, but also the SELECT clauses. Do you have queries samples ?
    If you are getting the data through a db-link, a way could be to replicate the remote data locally (with in a MVIEW for example), you could save a lot of time to transfer the data over the network only once instead of three times.
    Nicolas.

  • Can u have a spry data set Object array.....

    Ok this is what i need to do. I need a spry object array to
    be created with in a function.
    Just like this.....
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Hijax Demo - Notes 1</title>
    <script language="JavaScript" type="text/javascript"
    src="includes/xpath.js"></script>
    <script language="JavaScript" type="text/javascript"
    src="includes/SpryData.js"></script>
    <script language="JavaScript" type="text/javascript">
    * @author nadeerak
    function test5(){
    funObjects = new Array();
    funObjectsObserver = new Array();
    funListList = new Array();
    x = new Array();
    x[0] = "First";
    x[1] = "Second";
    x[2] = "Third";
    x[3] = "Fourth";
    for(y in x)
    funObjects[x[y]] = new
    Spry.Data.XMLDataSet("notes"+y+".xml", "notes/note");
    funObjectsObserver[x[y]] = new Object;
    funListList[x[y]] = null;
    funObjects[x[y]].useCache = false;
    funObjects[x[y]].loadData();
    funObjectsObserver[x[y]].onDataChanged = function(dataSet,
    data)
    funListList[x[y]]=funObjects[x[y]].getData();
    alert(funListList[x[y]].length);
    funObjectsObserver[x[y]].onPreLoad = function(dataSet, data)
    alert("preload");
    funObjectsObserver[x[y]].onPostLoad = function(dataSet,
    data)
    funObjects[x[y]].addObserver(funObjectsObserver[x[y]]);
    </script>
    </head>
    <body>
    <input type="button" value="button" name="button"
    onclick="test5();">
    </body>
    </html>
    i have note0.xml to note6.xml
    once the button clicked i need all the alerts to give the
    length. But this dyanimically created objects does not load. Why?
    Can we do something like this in SPY? like creating a spry
    object array........... can we?
    The error im getting is after two alerts i get
    "funListList[]. is null or not an object " individually it works
    very well?
    why is this?
    To my knowladge the data is not loaded after the second....
    Hmmmm how come? im using seperate objects....
    PLS ALL SPRY LOVERS help me......

    Hi,
    Check this sample:
    http://labs.adobe.com/technologies/spry/samples/DataSetSample.html
    Check the source code to see how we build a data set from an
    array.
    Hope this helps,
    Donald Booth
    Adobe Spry Team

  • Can we store result set in session..??

    can we store result set object in session..??if yes ,,say i close the connection and use that result set object in some another page,,what happen if u call updateRow(),deleteRow() or insertRow()

    You can store a result set object in session.
    However you also have to keep that result sets connection open and dedicated to that result set.
    In that scenario you will have a 1 db connection per session. Not very nice. And NOT recommended.
    Once you close a ResultSet's connection then you shouldn't access the ResultSet. Simple as that.

  • Can I use same result set for two queries?

    Hi,
    Can I use the same result set for two queries?
    For example:
    ResultSet rs = null;
    rs = ps.executeQuery(query1);
    while (rs.next()) {
    rs = ps.executeQuery(query2);
    while (rs.next()) {
    Is it OK to use? or Is there any preformance issues?
    Appreciate your help.
    Thanks in advance.
    Prasad Vagolu

    Sure. You have a variable of ResultSet type. First you create a ResultSet and assign it to that variable. Then later you create another ResultSet and assign it to that same variable. Assigning an object reference to a variable takes essentially no time, and at any rate it isn't any faster to assign it to a different variable. Also, no matter whether you use one variable or two, you are still creating two ResultSets.
    However, you really should be closing your ResultSets after you finish using them. That's nothing to do with the assigning-to-a-variable question.

  • Result set --- can you reference in two locations (jsp and doVIew())

    I need help figuring out what I am doing wrong.
    In my doView() function I am saving a result set
      NamingEnumeration person = details.executeDetails(fullname);I need to reference this result set from my doView method and inside my jsp page, this is why I have stored this inside a session variable.
    //doView() method
    NamingEnumeration person = details.executeDetails(fullname);
    if(person != null){                           
      while(person.hasMore()){
       SearchResult sr = (SearchResult)person.next();
       Attributes attributes = sr.getAttributes();
       Attribute attr = attributes.get("x500UniqueIdentifier");
       if (attr != null) {
        Object val = attr.get();
        byte[] buf = (byte[])val;
        String number = new String(buf);
        person_number = removeLeadingZeros(number);
    person.close();
    session.setAttribute("person", person, PortletSession.PORTLET_SCOPE);     
    //jsp page
    NamingEnumeration results = (NamingEnumeration)renderRequest.getPortletSession().getAttribute("person");
    <% if(results != null){
          while(results.hasMore()){
            SearchResult sr = (SearchResult)results.next();
            Attributes attributes = sr.getAttributes();
            String fullName = attributes.get("fullName").toString();
            String description = attributes.get("description").toString();
            String title = attributes.get("title").toString();
            String mail = attributes.get("mail").toString();
            String eduPersonPrimaryAffiliation = attributes.get("eduPersonPrimaryAffiliation").toString();
            String telephoneNumber = attributes.get("telephoneNumber").toString();
            String postOfficeBox = attributes.get("postOfficeBox").toString();
            String[] Name = fullName.split(":");
            String[] Desc = description.split(":");
            String[] JobTitle = title.split(":");
            String[] Email = mail.split(":");
            String[] Class = eduPersonPrimaryAffiliation.split(":");
            String[] Phone = telephoneNumber.split(":");
            String[] BoxNo = postOfficeBox.split(":");
            %>
                //....................... Bunch of printing information here        
               }//end while
         }//end if
         else{%>
              <div>No results found.</div>
         <%}
          results.close();
    Can you not reference a result set from both of these locations?
    Thanks.

    Hi Gravy Train,
    I'm curious about why you are using 2 loops.   You mentioned one is for monitoring and one is for DAQ....what do you mean by that?   What is the overall goal of this piece of code.   Also, I noticed that you are not closing the task.   Since this is just a subset, I realize you could be closing it in your actual code, but just in case you're not.....it is very important that you close all tasks when you are down acquiring data.
    Best Regards,
    Starla T  

  • Result Set problem!!!Plz urgent

    Hi,
    I am using jsp page with database connection.In jsp page i have two button called move next and move previous.
    In database 2 records are there.If i open the jsp page first record will be displayed.If i click next record it showing 2nd record.If i click previous record it showing 1st record.Once again if i click next record it is showing that record not found...........What may be the problem????.
    Note:For each time button click i will pass the result set object in session variable.Whether it is a correct one..
    Plzz help me ya...........

    this is for move next:::
    ResultSet result=null;
    Connection connection=null;
    String candyid="";
    result = (ResultSet)session.getAttribute("resget");
    result.next();
    if(!result.next())
    %>
    <Script>
    alert("Record Not Found");
    </Script>
    <%
    result.previous();
    candyid=result.getString(1);
    session.setAttribute("resget",result);
    %>
    <input type=hidden name="hide" value="yes">
    <input type=hidden name="nextid" value=<%= candyid %>>
    <Script>
    document.AddCandetails2.action="modifyCandidate1.jsp";
    document.AddCandetails2.submit();
    </Script>
    <%
    else
    candyid=result.getString(1);
    System.out.println("candi next id"+candyid);
    session.setAttribute("prevresget1",result);
    System.out.println("resultset for set attar in next"+result);
    %>
    <input type=hidden name="hide" value="yes">
    <input type=hidden name="nextid" value=<%= candyid %>>
    <Script>
    document.AddCandetails2.action="modifyCandidate1.jsp";
    document.AddCandetails2.submit();
    </Script>
    <%
    this is for move previous:::
    ResultSet result=null;
    Connection connection=null;
    String candyid="";
    if(session.getAttribute("prevresget1")==null)
    result = (ResultSet)session.getAttribute("resget");
    else
    result = (ResultSet)session.getAttribute("prevresget1");
    if(!result.previous())
    %>
    <Script>
    alert("Record Not Found");
    </Script>
    <%
    result.next();
    candyid=result.getString(1);
    session.setAttribute("resget",result);
    %>
    <input type=hidden name="hide" value="yes">
    <input type=hidden name="nextid" value=<%= candyid %>>
    <Script>
    document.AddCandetails2.action="modifyCandidate1.jsp";
    document.AddCandetails2.submit();
    </Script>
    <%
    else
    candyid=result.getString(1);
    session.setAttribute("prevresget1",result);
    %>
    <input type=hidden name="hide" value="yes">
    <input type=hidden name="nextid" value=<%= candyid %>>
    <Script>
    document.AddCandetails2.action="modifyCandidate1.jsp";
    document.AddCandetails2.submit();
    </Script>
    <%
    this is the code............... can u give me the solution

  • Can i open more than one Resultset object

    hi in my program i have to retrive data from three table and the data from three
    table i have to use in another one
    i wanna know that can we open more than one ResultSet object within one
    try{
    }catch{] block ( i means ResultSet rs = st.excuteQuery(query) more than one time for different -different tables)
    or there is any other way to do this

    You can only have one active result set per statement at a time.
    Depending on the driver you are using you might be able to have more than one active statement (and result set) on one connection. Or not.
    Try catch has nothing to do with that.
    If you are nesting result sets then it is likely you should be using a join (SQL) which would then only require one result set.

  • Result set properties

    I have created a class that uses a result set object. I need to scroll through the result set twice and my code is not working. My first question is:
    Is there a method that will return the length of a result set?
    If there is a length method that will solve my problem. Otherwise from what I understand if I set my result set to have the following properties it will work:
    (ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)
    In the API it states that you pass the above as a parameter to the createStatement method. However in our application we do not use the createStatement method. I am wondering is there any other way of setting the result set to have these values?
    The problem is occuring with the following method:
    public boolean selectEngsByClientName (TransactionManager tm) throws Exception
    boolean foundData = false;
    ResultSet clientResultSet = null;
    PreparedStatement prepStatement = null;
    String sqlStatement;
    int i = 0;
    int countResultSet = 0;
    sqlStatement = " SELECT " +
    " eg.eng_engagement_no engNo, " +
    " cl.cln_short_name clientName, " +
    " eg.eng_name engName " +
    " FROM " +
    " far.engagements eg, " +
    " far.clients cl" +
    " WHERE " +
    " upper(cl.cln_short_name) like upper('" + this.clientSearchName +"%') AND" +
    " eg.cln_client_no = cl.cln_client_no AND" +
    " eg.eng_status_code = '2'";
    try
    // Instantiate prepared statement using the connection in the TransactionManager class
    prepStatement = tm.getConnection().prepareStatement(sqlStatement);
    // Execute the sql statement
    tm.startTransaction();
    clientResultSet = prepStatement.executeQuery();
    //Determines number of objects in result set so that array size can be set
    while (clientResultSet.next())
    countResultSet ++;
    //Creates array of engagement objects that is the same length as the result set
    engagement = new Engagement[countResultSet];
    for (int index = 0; index < engagement.length; index++)
    engagement[index] = new Engagement();
    clientResultSet.first();
    while (clientResultSet.next())
    // Populate DAO attributes with data in the ResultSet returned
    System.out.println(clientResultSet.getString("engNo"));
    engagement.setEngNo(clientResultSet.getString("engNo"));
    engagement[i].setClientName(clientResultSet.getString("clientName"));
    engagement[i].setEngName(clientResultSet.getString("engName"));
    i ++;
    // Set the result to success
    foundData = true;
    tm.endTransaction();
    catch (SQLException sqle)
    tm.rollback();
    // Re-throw custom exception
    throw new Exception();
    finally
    // Close the prepared statement and result set if not null
    try
    if (clientResultSet != null)
    clientResultSet.close();
    if (prepStatement != null)
    prepStatement.close();
    catch (Exception e) {}
    return foundData;

    Good atleast ur concepts are clear
    ok then do both the thing simultaneously this way
    engagement.setClientName(clientResultSet.getString("clientName"));
    engagement.setEngName(clientResultSet.getString("engName"));
    ResultSet rs=St.executeQuery()
    int count=0;
    While(rs.next())
    count=count+1;
    engagement.setClientName(rs.getString("clientName"));
    engagement.setEngName(rs.getString("engName"));
    System.out.println("Length od ResultSet = "+count);

  • Error in result set from join query

    I get a SQL exception from the JDBC thin driver when I make a getXXX( "string" ) call on a result set object when the query is a join. Aliases don't seem to help.
    Below is the stack trace.
    Anybody have any ideas?
    matt
    ResultSet.findColumn
    java.sql.SQLException: Invalid column name: get_column_index
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:427)
    at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java, Compiled Code)
    at oracle.jdbc.driver.OracleResultSet.findColumn(OracleResultSet.java:680)
    at person.PersonMgr.getForEdit(PersonMgr.java:114)
    at person.PersonMgr.getForView(PersonMgr.java:168)
    at person.PersonMgr.getPersonForView(PersonMgr.java:164)
    at nwsession.NWSession.login(NWSession.java:224)
    at jsp.dologin._jspService(dologin.java:241)
    at com.livesoftware.jsp.HttpJSPServlet.service(HttpJSPServlet.java:31)
    at com.livesoftware.jsp.JSPServlet.service(JSPServlet.java:129)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
    at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code)
    at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116)
    at com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JRunProxyServiceHandler.java, Compiled Code)
    at com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.java, Compiled Code)

    Your reference to NS.REQDATE is too deep. Oracle will only allow you to reference a column from the main query one level deep.
    I think you can just change that query into this:
    (Select AVG(((cpath.REQUESTDATETIME)- NS.REQDATE)*1440) AvgTime
    FROM usersessiondetails cpath
    Where cpath.Userkey=(Select Userkey from ods_user where userid=NS.UserId and namespace=NS.Namespace)
       and cpath.acctnum=aCCTNUM
       and cpath.transactionname IN (AUTH_LOGOFF' )
       and cpath.REQUESTDATETIME = NS.REQDATE )You do not need the extra query level to do the AVG.

  • Compare 2 result sets

    Hi,
    I have two queries which count the number of lines of the tables
    of the same schema in two databases .
    How can I compare the two result set.
    Thanks in advance

    Are you looking for something like this :
    Suppose First resultset is like this :
    SQL> select * from tab1;
    TABLE_NAME                          COUNT
    SALGRADE                                5
    PROD                                   32
    EMP                                    14
    DEPT                                    4
    CUST                                    7
    BONUS                                   0
    TEST                                   10
    7 rows selected.
    and Second resultset like this :
    SQL> select * from tab2;
    TABLE_NAME      COUNT
    TAB_NEW            20
    SALGRADE            5
    EMP                14
    DEPT                6
    Now Comparision :
    select a.table_name,
    a.count,
    b.table_name,
    b.count
    from tab1 a
    full join tab2 b
    on a.table_name=b.table_name
    WHERE A.COUNT <> B.COUNT
    OR A.TABLE_NAME IS NULL
    OR B.TABLE_NAME IS NULL
    TABLE_NAME                          COUNT TABLE_NAME      COUNT
    PROD                                   32
    DEPT                                    4 DEPT                6
    CUST                                    7
    BONUS                                   0
    TEST                                   10
                                              TAB_NEW            20
    6 rows selected.
    Regards
    Girish Sharma

  • Not able to access the result set from one member function to another

    Im new to jdbc
    I have declared a connection object , a result set object and statement object in one member function and i am not able to access these in another member function. But both are in the same class
    Kindly help
    Thanks
    Shasi

    Kindly refrain from double-posting:
    http://forum.java.sun.com/thread.jspa?threadID=700659&tstart=0
    - Saish

  • SQLException : Result Set is IDLE

    Hi,
    Am accessing a DB stored procedure, executing it using executeQuery() & then fetching the resultset. There are 2 resultset objects returned. Am getting this exception when fetching the result set objects.
    It says soemthing like:
    "Result Set is IDLE as no row is being accessed currently."
    Any thoughts as to why this exception occurs?
    Thanks.

    Hey, Thanks so much! I think that's why I got the execption. Looks like I missed that check by mistake. I'll try with it to see if it works.

Maybe you are looking for

  • Macbook pro 13inch running slow and losing connection (had it for only a year)

    Will someone please help me.. I've only had my mac book pro for a year only and few months ago I started experiencing that my macbook has been running slow lately.. I still have alot of memory in it because I only use it for browsing the net and savi

  • Loading dynamic content in an accordion panel?

    Basically I am looking to be able to incorporate the type of functionality that is shown in the Products demo, except using an accordion instead of the table - so the xml would feed into the accordion, and the the data in the accordion would be click

  • Account Not found on resource

    Hi frenz, I got the following error when I tried to edit the user A29666. Account 'A29666' not found in Resource 'SecurID - usatli69'. XPRESS exception: Can't call method listResourceObjects on class com.waveset.ui.FormUtil ==> com.waveset.util.Waves

  • Transfer data to MacBook Pro

    Hello, So my G5 broke (3 months to repair) and I currently only have the hard drive from it. Is there anyway to transfer the data from that hard drive to my MacBook Pro? Could a Genius at the Apple store help with this? Thankful for any advice - it's

  • Host adapters libraries missing from the CS SDK

    Hi, I have some extensions built with Flah Builder 4.5 and the CS Extension Builder, that I had to compile via ANT in order to port them to a continuous integration server. (Hudson) I used the CS SDK 1.5.0. to do so, it includes all CS libraries (i.e