How move in the ResultSet

i need to fill a String names[ ] whit the result of a querry (select name from people) the result is a list of names and i need to fill a list in one combo box
and i have some problems because i dont understand how to move in the resulset and when I use
names[ ] = ResultSet.getString("I dont know what put in here" );

Statement stmt = ...
ResultSet rset = stmt.executeQuery("Select ...");
while(rset.next()) {
String name = rset.getString(1);
int age = rset.getInt(2);
}

Similar Messages

  • How to write the resultset into a text file

    how to write the resultset into a text file

    You can use the java.io.* package to write to files.
    API: http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html
    Tutorial: http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • How to map the Resultset values to multiple tags on target strcture

    Hi All,
    We have an UDF ,whihc is returing Resultset . How do we map/extract the each element of resultset to diffrent fields on the target strcure in graphical mapping.
    Let me know,if any blog exist for same.
    Thanks for your support and advice.
    MK

    Hi,
    you should be having some condition based on which you will map your resultset values to different target fields.......so have that condition as an input to your UDF in graphical mapping.............then use this condition value in your UDF and output the data which should come on this condition in the resultset..........then in graphical mapping, map your target fields with this UDF and condition and output the UDF output to the target node.........
    Regards,
    Rajeev Gupta

  • JDBC to FILE scenatio: How to map the resultSet?

    Hi,
      I am doing the JDBC-XI-File integration scenario.
    I am getting the data from the Database as the following XML:
    <b><?xml version="1.0" encoding="utf-8" ?>
    - <resultset>
    - <row>
      <EMPNAME>Nagarjuna</EMPNAME>
      <EMPID>100</EMPID>
      <SALARY>15000</SALARY>
      <DEPT>dev</DEPT>
      </row>
    - <row>
      <EMPNAME>Mahendra</EMPNAME>
      <EMPID>101</EMPID>
      <SALARY>25000</SALARY>
      <DEPT>dev</DEPT>
      </row>
      </resultset></b>
       how to do the mapping?
       I actually created a Data Type(JDBCSend_DT) & Message type & Message Interface for the Sender JDBC.
      The mapping program I defined was not between <b>JDBCSend_MT</b> and <b>FileReceiver_MT</b>. (NOT BETWEEN resultSet and FileReceiver_MT)
       Please help me to solve this.
    Thanks in advance,
    Nagarjuna.

    Hi,
      I am getting the following error when I tested.
    <b>11:42:04 Start of test
    Document start
    Start tag [ns1:FileRecv_MT]
    Add raw attribute [ xmlns:ns1="http://www.xxx.com/file"]
    Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Root Cause: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3)(:main:, row=2, col=3) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2733) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2778) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:227) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:141) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:156) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:259) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) -
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Caused by: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2733) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2778) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:227) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:141) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:156) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:259) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) ... 3 more Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3)
    11:42:04 End of test</b>
    Thanks,
    Nagarjuna.

  • How to get the resultset of WCM_PLACEHOLDER service using ridc

    Hi,
       I am trying to call WCM_PLACEHOLDER  service using ridc api. I was able to set dataFileDocName and templateID, but was unable to retreive the result set, since I am not sure with which name should I have to search in the result set. AS like GETSEARCHRESULTS i tried with "SearchResults" but not success. Sample code below I tried.
    DataBinder dataBinder = serviceResponse.getDataBinder();
    dataBinder.getResultSet("SearchResults"); ----> This is the line that is not working as looks like I need to replace "SearchResults" with something else.
    I tried googling this for, but couldn't find useful information any where.
    Appreciate your help here.
    Thanks,
    Kesava.

    Hi Kesava ,
    WCM_PLACEHOLDER - http://docs.oracle.com/cd/E28280_01/doc.1111/e10615/c11_ss_services.htm#SSTRF503
    This is not a search service but it is used to evaluates a placeholder, allowing the contents of the placeholder to be retrieved directly from anywhere the Oracle Content Server can be seen from.
    Code snippet to retrieve the details using RIDC is as follows :
    // Databinder for  placeholder request
                DataBinder dataBinder = idcClient.createBinder();
                dataBinder.putLocal("IdcService", "WCM_PLACEHOLDER");
                dataBinder.putLocal ("dataFileDocName","<content id of Contributor Data File>");
                dataBinder.putLocal("templateID" ,"<Content id of Region Template>");
    // Write the data binder for the request to stdout
                serializer.serializeBinder (System.out, dataBinder);
    // Send the request to Content Server
                ServiceResponse response = idcClient.sendRequest(userContext,dataBinder);
    // Get the data binder for the response from Content Server
                DataBinder responseData = response.getResponseAsBinder();
    // Write the response data binder to stdout
                serializer.serializeBinder (System.out, responseData);
    //Retrieve the data file text from LocalData Section :
                DataObject localData = responseData.getLocalData();
    //Printing the value which is required to be displayed
                System.out.println ("Placeholder Content / text is    : " + responseData.getLocal("placeholderContent"));
    // Retrieve the SearchResults ResultSet from the response
                DataResultSet resultSet = responseData.getResultSet("DOC_INFO");
    // Iterate over the ResultSet, retrieve properties from the content items
                for (DataObject dataObject : resultSet.getRows ()) {
                    System.out.println ("Title is: " + dataObject.get ("dDocTitle"));
                    System.out.println ("ContentID is : " + dataObject.get ("dDocName"));
                    System.out.println ("######");
    Hope this helps.
    Thanks,
    Srinath

  • How to get the resultset from the field number(11,2) ???

    i can get it by rs.getString() but i do not know how to convert String to Number(11,2)?

    i dun know exactly what u meant, but to convert string to int is to use Integer.parseInt("555")...

  • How can I move the cursor in the ResultSet?

    Hi all,
    The following is part of my coding...
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
             ResultSet codes = getCodes();
            try
                    codes.first();          
                    Code c = getCode (codes);
                    jLabel8.setText(c.scode);
                    jTextField2.setText(c.name);
                    jLabel9.setText(c.ic);
                    jTextField4.setText(c.add);
                    jTextField5.setText(c.phone);
            catch (SQLException e)
                System.out.println(e.getMessage());
        private static ResultSet getCodes()
            Connection con = getConnection();
            try
            Statement s = con.createStatement();
            String select = "SELECT [Student-File].* " + "FROM [Student-File];" ;
            ResultSet rows;
            rows = s.executeQuery(select);
            return rows;
            catch (SQLException e)
                System.out.println(e.getMessage());
            return null;
        } I would like to moves the cursor to the first row in the ResultSet object...
    But an error occured...
    Result set type is TYPE_FORWARD_ONLY
    I have tried to change
    Statement s = con.createStatement();to
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE);But a warning existed...
    cannot find symbol
    symbol : method createStatement(int)
    location : interface java.sql.Connection
    Can anyone help me?Thanks.
    Ning.

    Hi,
    Actually I would like to create 2 button, one is named as NEXT, another one is named as PREVIOUS. Once i click on the NEXT or PREVIOUS button, a query statement will be executed to retrieve the information of all of the student in a table. At the same time, the name, student code, address, ic and phone number of a student will be displayed by label respectively. After that, if I click on the NEXT button, the information of the current student will be replaced by the information of the next student. By the way, if I click on the PREVIOUS button, the information of the current student will be replaced by the information of the previous student.
    Ning.

  • I have downloaded a movie, but it did not appear in itunes, I went to select "Check for Downloads" under store, and I received a message that there were 25 errors in the download. There is no information on how to correct the problem.

    I purchased a movie from the itunes store, it had errors (25) in the down load, and it does not allow me to down load again. I just get directed to the Store, and Check for available downloads, which when selected again informes me that 25 errors occured, etc... how do I get this fixed so I can download the movie?

    Yes, done all that but there is no adobe flash player listed in the add ons >plug ins site. However in the program listings on the start section adobe flash player is displayed.
    I have tried down loading it again and although I have done this from downloads and it displays as done it does not reappear in plug ins.
    The plug ins I have got listed in Tools>Add_ons>Plugins are
    Microsoft RDM 9.0.0.3250
    Microsoft RDM 9.0.0.3250
    Mozilla Default Plug in 1.0.015
    Shockwave flash 10.01.2.76
    Windows Media player Plug in dynamic link library 3.02.6.28

  • HT3951 I purchased a movie on the AppleTV 2 but it is not showing up in iTunes on my desktop computer. How can I sync? (have lastest version of iTunes and ATV2 software)

    I purchased a movie on the AppleTV 2 but it is not showing up in iTunes on my desktop computer. How can I sync? (have lastest version of iTunes and ATV2 software)

    Of course it always works, what are you talking about.
    I appreciate that re-downloading is only available in the US and then only with certain content. However content that cannot be re-downloaded is not offered for purchase on the Apple TV.

  • I downloaded and bought a movie from iTunes on my iPad and now want the same movie on my MacBook Pro but its not offering me to download it, it giving me the options of buying it which I already did. How I get the movie onto my MacBook?

    I downloaded and bought a movie from iTunes on my iPad and now want the same movie on my MacBook Pro but its not offering me to download it, it giving me the options of buying it which I already did. How I get the movie onto my MacBook?

    You can connect the iPad to your Mac's iTunes and do File > Devices > Transfer Purchases, that should copy it over to the Movies part of your library.
    Depending upon what country that you are in, and whether the film studio allows it, you might also be able to re-download it on your Mac via the Purchased link under Quicklinks on the right-hand side of the iTunes store home page.

  • How to get the values from the resultset???

    I have a problem with this code given below,
    i am executing an sql query which return a union of values from two tables.
    the problem here is how do i read the values from the resultset.
    here is the code....
    package com.webserver;
    import java.sql.*;
    public class UnionDemo{
    public static void main(String args[]){
    Connection connection =null;
    Statement statement =null;
    ResultSet rs =null;
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    connection = DriverManager.getConnection("jdbc:oracle:thin:@:1521:ORCL","scott","tiger");
    statement = con.createStatement();
    rs = statement.executeQuery("(select tablename from node where appid=432) union (select tablename from uomnode where appid=432)");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next()){
    System.out.println(rs.getString(1));
    // instead of rs.getString(1) I also used rs.getString("tablename") but of no success....
    }//end of while
    }catch(Exception exp){
    exp.printStackTrace();
    finally{
    try{
    if (rs!=null) rs.close();
    if (statement!=null) statement.close();
    if (con!=null) con.close();
    }catch(Exception exp1){
    exp1.printStackTrace();
    }//end of finally
    }//end of main
    }//end of class
    when i execute this program i get an oracle error ORA-01009
    which says (java.sql.SQLException: ORA-01009: missing mandatory parameter)
    can anyone help to retrieve the values from this resultset...
    thanx

    [cut]
    i am executing an sql query which return a union of
    values from two tables.
    the problem here is how do i read the values from the
    resultset.[cut]
    When the error occours?
    1) Executing query ?
    2) Retrieving the field from the resultSet ?
    3) ecc. ?
    BTW, first of all, try to execute the query removing the parenthesis
    of the two select statement. I know that there are some problem
    with the oracle jdbc driver about them.
    Hope it helps.

  • How do I get a refund for my movie. Tried to connect my rented movie to the LCD through an apple adapter but said unauthorized.

    How do I get a refund for my movie from iTunes that I rented for ipad2? Tried to connect my rented movie to the LCD through an apple adapter but said unauthorized.

    Probably can't get a refund, but.........
    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
     Cheers, Tom

  • How can I make my Apple TV more reliable? It takes a day to download a HD movie on a T1 to play later, but when I try to play the movies, Apple TV can't, and says try again later. Doesn't the day download time put the HD movie on the Apple TV device?

    How can I make my Apple TV work? I downloaded two movies, to play later, on April 4, 2014. I tried to watch them this evening only to get a message they are not available and to try later. How long can it take Apple to download the movies? I encourage anyone thinking about buying an Apple TV to get a different media player that is reliable. Apple TV is not worth the money, nor the time it takes to download movies, nor the effort trying to get your money back when Apple TV fails,and it failsl oftern.. Apple never seems to have a problem charging for the movies, but it frequently has a provlem delivering what people pay for.

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

  • How to get both, the ResultSet and Output (return value) from Oracle Stored Procedure

    Hi! I am doing a conversion from MSSQL to Oracle with C++ and MFC ODBC. Any comment is appreciated!! I have Oracle 8i and Oracle ODBC 8.1.6 installed.
    My question is how to retrieve the return value AND ALSO the resultSet at the same time by using Oracle function without modifying my souce codes (except puttting mypackage. string infron of my procedure name, see below).
    -- My source code in C++ with MSSQL ....
    sqlStr.Format("{? = call ListOfCustomers(%i)}", nNameID);
    RcOpen = CustomerList.Open(CRecordset::forwardOnly, sqlStr, CRecordset::readOnly );
    Where CustoemrList is a Crecordset object...
    IN DoFieldExchange(CFieldExchange* pFX) I have ...
    //{{AFX_FIELD_MAP(CQOSDB_Group)
    pFX->SetFieldType(CFieldExchange::outputColumn);
    RFX_Long(pFX, T("Name"), mCustoemrName);
    //}}AFX_FIELD_MAP
    // output parameter
    pFX->SetFieldType( CFieldExchange::outputParam );
    RFX_Int( pFX, T("IndexCount"), mCustomerNumber);
    -- m_CustomerNumber is where i store the return value!!!
    -- In Oracle Version, i have similar codes with ...
    sqlStr.Format("{? = call mypackage.ListOfCustomers(%i)}", nNameID);
    RcOpen = CustomerList.Open(CRecordset::forwardOnly, sqlStr, CRecordset::readOnly );
    -- I have oracle package/Body codes as following...
    create or replace package mypackage
    as
    type group_rct is ref cursor;
    Function listgroups(
    nameID NUMBER ,
    RC1 IN OUT Mypackage.group_rct ) return int;
    end;
    Create or replace package body mypackage
    as
    Function listgroups(
    NameID NUMBER ,
    RC1 IN OUT Mypackage.group_rct )return int
    IS
    BEGIN
    OPEN RC1 FOR SELECT Name
    from Customer
    WHERE ID = NameIDEND ListGroups;
    END
    return 7;
    END listgroups;
    END MyPackage;
    Ive simplified my codes a bit....
    null

    yes, it is exactly what i want to do and I am using Oracle ODBC driver.
    I tried using procedure with 1 OUT var fo numeric value and the other IN OUT ref cursor var instead of function, but error occurs when I called it from the application. It give me a memory ecxception error!!
    sqlStr.Format("{? = call ListOfCustomers(%i)}", nNameID);
    RcOpen = CustomerList.Open(CRecordset::forwardOnly, sqlStr, CRecordset::readOnly );
    it seems to me that the ? marker var is making all the trouble... can you please give me any more comment on this?? thanks!
    null

  • How can I choose a symbol for presentation a movie in the finder?

    I have several movies composend mainly of single photos. I want to show a movie in the finder with a movie-specific photo. I got the impression that iMovie chooses a phot by random.
    How can I specify my preferred picture (it should be the very first in the movie)?

    ... or press the (left) mouse button immediately after chime, and keep it until disk is ejected.

Maybe you are looking for

  • There was an error in the App Store. Please try again later. (null)

    I seem unable to purchase from the Mac App Store. Free downloads work fine, but purchases do not. iTunes purchases are fine, as are iOS purchases. Firstly I get "Your Purchase Could Not Be Completed - For assistance, contact iTunes Support at www.app

  • Is the canvas something like "the final output"? Or is that the viewer?

    I am making a video of my HD footage i shot with my Full HD Camcorder (Sony HDR-SR12). When i go through te timeline and play something, it shows fully in my viewer, but in the canvas i get only a selection of the full image (it seems that it is zoom

  • Account group Search

    Hi, I have a problem here. I am using Account_group field to use as a search field in Accounts application. I only get results for Rh SOld to party, watever be the choice for the account_group. Please let me know if u have any idea. Thanks

  • Can I revert to vanilla page?

    I've unsuccessfully tried to extend a VO in our dev environment. I now get this error: Exception Details. oracle.apps.fnd.framework.OAException: Message not found. Application: , Message Name: oracle.adf.mds.exception.MDSException: "/oracle/apps/per/

  • Flash video, cut around a person (floating person)

    looking for direction..   I'd like to record someone talking,  and somehow cut out around the person to use in Flash.   So I can fill in the background or  put the person over an image or something.  Any ideas on software or people who can do this? T