Get String array from Resultset

In Tomcat 6.0.20 I am attempting to create an Oracle 9i resultset that outputs as a String array and need help creating the method.
The CityData getCityList() method will be called in the CityServlet:
CityServlet: String [] citys = cityData.getCityList();
I started my below attempt but not sure how to handle the List/array part:
CityData class: public ArrayList<String> getCityList() {     try {           .....           List<String> citys = new ArrayList<String>();           while(rs.next())           {               citys.add(rs.getString("city"));           }       }     return citys; }

Hi!
Try this:
public City[] getCitys() throws Exception
    String sql = "SELECT * FROM citys ORDER BY name ASC";
    Vector v = new Vector();       
    ResultSet rs = null;
    java.sql.Statement stmt = null;
    try
        stmt = conn.createStatement();
        rs = stmt.executeQuery(sql);
        while( rs.next() )
            City city = new City(rs);
            v.add(city);
    catch (Exception e) { throw e; }
    finally
        try
            if (stmt != null) stmt.close();
        catch (Exception e) { throw e; }
    City[] citys = new City[v.size()];
    for (int i = 0; i < citys.length; i++)
        citys[i] = (City)v.get(i);
    return citys;       
}Edited by: Bejglee on Mar 3, 2010 3:59 AM

Similar Messages

  • Example of passing String Array from java to C using JNI

    hi all
    i searched net for passing string array from java to C but i dont get anything relevent
    i have
    class stu
    int rollno
    string name
    String [] sub
    i want to pass all as String array from java to C and access it C side

    1. Code it as though it were being passed to another method written in java.
    2. Redefine the method implementation to say "native".
    3. Run jnih to generate a C ".h" file. You will see that the string array
    is passed into C as a jobject, which can be cast to a JNI array.
    4. Write the C code to implement the method and meet the interface
    in the generated .h file.

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • Passing values to form bean string array from dynamic added textboxes

    Hi,
    I am unable to pass values to form bean string array from a jsp in which I have incorporated dynamically adding of textboxes in javascript.
    I have given add/delete row option in the jsp. If there is single row, this is working fine. But after adding a row, I am not able to either do any validations on added textboxes or pass the values to the String array form bean variable.
    code snippet:
    var cell6 = row.insertCell(4);
    var element5 = document.createElement("input");
    element5.type = "text";
    element5.className = "formtext1";
    element5.size = "5";
    element5.value = "00.00";
    element5.name= "qty"; // this is a string array of the form bean.
    element5.onchange=function() {checkNumeric(this);};
    cell6.appendChild(element5);
    <html:text styleClass="formtext1" property="qty" value="" size="5" styleId="qty" onchange="checkNumeric(this)"/></td>
    form bean declaration
    private String[] qty; Please help.
    Edited by: j2eefresher on Jan 12, 2010 11:23 PM

    Shivanand,
    There's no need to post that much code when you could create a very short test case that demonstrates only the problem you are having.
    You're using &NAME. notation on something that isn't a page or application item. You can't reference PL/SQL variables that way (or any other way) outside the PL/SQL scope. For your situation, you could create a page item named P55_DOCID and assign it a value in the PL/SQL process (:P55_DOCID := DOCID;), then reference &P55_DOCID. in HTML areas like the success message.
    Scott

  • How can I get Data in String Array from TABLE

    hi all
    I have table in MS Access databse called Login with two coulmn (User, Password),
    I want to get all the User Name in a string[] called USER,
    (LIKE USER = {"AA","BB","CC",........"zz"};
    i made somthing like this
    public class User_Name
    final String driver = Login_Dialog.T_driver.getSelectedItem().toString();
    final String url = Login_Dialog.T_URL.getSelectedItem().toString();
    final String user = Login_Dialog.T_User.getText().toString();
    final String password = new String(Login_Dialog.T_Password.getPassword());
    static Connection connection;
    static Statement statement;
    static String sql;
    static ResultSet rs = null;
    static String[] User ;
    public String User_Name()
    try
    //Load Driver
    Class.forName(driver);
    // Make Connection
    connection=DriverManager.getConnection(url,user,password);
    // Create Statement
    statement = connection.createStatement();
    sql = "SELECT User FROM Login" ;
    // Create Resultset
    rs = statement.executeQuery(sql);
    ResultSetMetaData MD = rs.getMetaData();
    int C_N = MD.getColumnCount();
    if(rs.next())
    for(int i = 2 ; i<=C_N ; i++)
    User = rs.getString(2);
    statement.close();
    rs.close();
    connection.close();
    return User;
    catch(ClassNotFoundException cnfex) {
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Failed to load driver..."+
    "\n"+cnfex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE,
    UserDatabase.Error_Icon);
    catch(SQLException sqlex){
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Unable to connect to Database..."+
    "\n"+sqlex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE,
    UserDatabase.Error_Icon);
    but i can get any thing so plz anybody send me a code for this one or help me out
    Thanx
    Regards
    Satinderjit

    in for loop, try;
    user[i] = rs.getString(2);

  • How to get An Array from PostgreSQL.

    When I design a programm to get an array object from a postgreSQL database, the programm give the following exception:
    "This method is not yet implemented"
    Who can help me?
    Thanks!!!!
    Here are my codes:
    import java.sql.*;
    class test {
    public static void main(String args[]) {
    String url = "jdbc:postgresql://localhost:5432/testdb";
    String query = "select * from table1";
    try {
    Class.forName("org.postgresql.Driver");
    Connection con = DriverManager.getConnection(url,"aa", "bb");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(queryStr);
    while(rs.next()) {
         Array array = rs.getArray("idnum");
    } catch(Exception ex) {
    System.out.println("Get Data Fail: " + ex);
    the table struct of "table1"
    =============================
    varchar(10) int4[]
    name | idnum
    -----------------+--------------------------------
    Bill | {100430,134630000,10000,10000}

    You pass a string to the getArray method. The parameter should be an integer, representing the desired column.

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • Please help how to get return array from rpg program on java code?

    Hi
    I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
    please suggest me regarding this issues I amn't so much aware on java & AS400.
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(p2.toBytes(" "));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
    byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
    parmList[1].getOutputDataLength();
    //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();
    Reply With Quote

    Try this :
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    AS400Array arrP2 = new AS400Array(p2, 4);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(arrP2.toBytes({"","","",""}));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
         Object[] objArr =  (Object [])arrP2.toObject( parmList[1].getOutputData() );
         for(int i =0; i<objArr.length;i++){
                System.out.println( " SKU " + i +" : " + objArr.toString());
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();

  • How can i get a array from a JSP ?

    Hi all,
    i have a STORED PROCEDURE like this:
    static public void getMyArray(double [] xx) {
    for (int i=0; i<myarr.length;i++){
    myarr=3.145*i;
    xx=myarr;
    return ;
    how can i get the array with XSQL and transform with a XSL ?
    Is this at all possible?
    Thanks for any help.
    Achim

    u r asking how ca u get array from jsp?
    and u r asking xsql ...some stuff i couldnot understand .can u repeat the question properly?
    null

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • How to get byte array from jpg in resource for Image XObject?

    Hi,
    Does anyone know how to get an array of bytes from a jpg from resource without an external library except MFC?
    The array of bytes is needed to create an Image XObject so it can be included in an appearance for an annotation.

    Sounds like a standard Windows programming question, not specific to the SDK.

  • How  to Pass String array from Java to PL/SQL  and this use in CURSOR

    hi,
    I cant understand how to pass Array String as Input Parameter to the Procedure and this array use in Cursor for where condition like where SYMPTOM in( ** Array String **).
    This array containing like (SYMPTOM ) to be returned from the java to the
    pl/sql (I am not querying the database to retrieve the information).
    I cannot find an example on this. I will give the PL/SQL block
    create or replace procedure DISEASE_DTL<*** String Array ***> as
    v_SYMPTOM number(5);
    CURSOR C1 is
    select distinct a.DISEASE_NAME from SYMPTOM_DISEASE_RD a
    where ltrim(rtrim(a.SYMPTOM)) in ('Fever','COUGH','Headache','Rash') ------- ***** Here use this array element(like n1,n2,n3,n4,n5..) ******
    group by a.DISEASE_NAME having count(a.DISEASE_NAME) > 3 ----------- ***** 3 is no of array element - 1 (i.e( n - 1))*****
    order by a.DISEASE_NAME ;
    begin
    for C1rec IN C1 loop
    select count(distinct(A.SYMPTOM)) into v_SYMPTOM from SYMPTOM_DISEASE_RD a where A.DISEASE_NAME = C1rec.DISEASE_NAME;
    insert into TEMP_DISEASE_DTLS_SYMPTOM_RD
    values (SL_ID_SEQ.nextval,
    C1rec.DISEASE_NAME,
    (4/v_SYMPTOM), --------**** 4 is no of array element (n)************
    (1-(4/v_SYMPTOM)));
    end loop;
    commit;
    end DISEASE_DTL;
    Please give the proper solution and step ..
    Thanking you,
    Asish

    I've haven't properly read through your code but here's an artificial example based on a sql collection of object types - you don't need that, you just need a type table of varchar2 rather than a type table of oracle object type:
    http://orastory.wordpress.com/2007/05/01/upscaling-your-jdbc-app/

  • How to get itemChild Array from plist into table 2 ?????

    Hi there,
    I am creating a project for the IPhone, using UITableViews.
    I have been looking at James' code and trying to adapt it.
    My project has two tableviews, and two tableview controllers. THe plist is an Array of dictionaries and each dictionary houses a name string and an ItemChild Array.
    The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
    here is the shape of the plist.
    <array>
    <dict>
    <key>name</key>
    <string>Category A</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    <dict>
    <key>name</key>
    <string>Category B</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    <dict>
    <key>name</key>
    <string>Category C</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    </array>
    </plist>
    here are the implementation files for the first and second tableviewControllers
    @implementation TableTutViewController
    @synthesize dataList1;
    - (void)viewDidLoad {
    [super viewDidLoad];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"newData" ofType:@"plist"];
    NSMutableArray* tmpArray = [[NSMutableArray alloc]
    initWithContentsOfFile:path];
    self.dataList1 = tmpArray;
    [tmpArray release];
    #pragma mark -
    #pragma mark Table view data source
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return dataList1.count;
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
    reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
    objectForKey:@"name"]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    #pragma mark -
    #pragma mark Table view delegate
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SecondViewController *secondViewController = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    secondViewController.dataList1 = [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
    [self.navigationController pushViewController:secondViewController animated:YES];
    [secondViewController release];
    #pragma mark -
    #pragma mark Memory management
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    - (void)viewDidUnload {
    - (void)dealloc {
    [super dealloc];
    @end
    And here is the code for the secondViewController
    #import "SecondViewController.h"
    #import "TableTutAppDelegate.h"
    #import "TableTutViewController.h"
    @implementation SecondViewController
    @synthesize dataList1;
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    - (void)viewDidUnload {
    #pragma mark Table view methods
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [self.dataList1 count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
    objectForKey:@"ItemChild"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    - (void)dealloc {
    [dataList1 release];
    [super dealloc];
    @end
    Any idea's on what is missing would be great. Do I need to create a new array to put the itemChild array into before loading it into the cell.textLabel.text??
    Any help would be fantastic,
    thanks
    Alex
    Message was edited by: alex200

    Hey Alex, welcome to the Dev Forum!
    alex200 wrote:
    I have been looking at James' code and trying to adapt it.
    Have you been looking at James as well? I'm wondering if you two are at the same school.
    The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
    Actually you passed the ItemChild arrays correctly (assuming dataList1 is declared as shown), but when you wanted the name for each element, you forgot that ItemChild was an array of strings, not an array of dictionaries:
    // SecondViewController.h
    @interface SecondViewController : UITableViewController {
    NSMutableArray *dataList1;
    @property (nonatomic, retain) NSMutableArray *dataList1;
    @end
    // SecondViewController.m
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    cell.textLabel.text = [self.dataList1 objectAtIndex:indexPath.row]; // <-- dataList1 is an array of strings
    // objectForKey:@"ItemChild"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    Other than the above, there wasn't much to correct. I just set the title of the first controller's nav item, since that's needed to display the default return button in the second controller's nav bar (but you probably had set that title in IB), and I also passed the name of the selected Category row to the second controller's nav item:
    // TableTutViewController.m
    - (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"Categories"; // <-- added in case title isn't in xib
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SecondViewController *secondViewController = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    secondViewController.dataList1 =
    [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
    secondViewController.navigationItem.title =
    [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"name"]; // <-- add title
    [self.navigationController pushViewController:secondViewController animated:YES];
    [secondViewController release];
    Overall it looks like you did a nice job. I think ItemChild was an array of dictionaries in James' plist, so that might be the reason your code matched his plist instead of yours.
    - Ray

  • Is there any way to get an array from an object?

    public class X {
    byte[] a = new byte[] {0x10,0x20};
    //Native method
    public native short testnative(X b);
    //C++
    JNIEXPORT jshort JNICALL Java_Native_testnative1 (JNIEnv *env , jobject obj, jobject testobj)
    Is there any way to get byte[] a from jobject testobj ?
    Pprimitive types and objects can be get by JNI functions(like GetIntField, GetObjectField etc.), but I didn't find fucntions like GetXXXArrayField(), then how can I do that?

    Hint: an array is an object.
    -slj-

  • Get string value from enumerated value on AE user interface

    Hello.
    I'm trying to get the string value from a enumerated value on a layer's property.
    When I get the value via script, I have  1D value. However, I need the string value.
    In this example, the value I would get is 1. Is there any way I can get "Horizontal and Vertical".
    I'm looking for a generic way (any property value defined this way), not for this case only.
    Thanks for the help.
    cheers.

    You get the selected value via the value property of the component.
    Timo

Maybe you are looking for

  • How can I get my old posts back

    I recently upgraded to Leopard and ILIFE08. I am in a frenzy bc the iweb does not have any of my old posts. I even tried to publish a new BLOG entry and now my entire webpage is back to the main template erasing all of my original info. Before the up

  • I need a new Delete key for my MacBook Pro

    My daughter ripped my delete key off my MacBook Pro and I need a new one. Anyone know where to get one from and how much they would be? Thanks!

  • I bought more iCloud storage but it's not showing up in my phone?someone please help

    I couldn't back my phone up because there wasn't enough space so I bought more storage but it's not showing up on my phone and still not letting me back up? Someone please help

  • Autosync?

    Am I alone with the problem of my Apple TV not autosyncing? Specifically, as new podcasts are downloaded into iTunes they will not automatically sync to the ATV. I can force a sync by restarting the ATV or manually syncing from my iMac. Yes, autosync

  • Thumbnail creation during Image Upload

    In my application, I am able to upload documents to content server using KPRO API's.  Image upload works fine and I can display the same file in webdynpro image UI element. Now while uploading the image, i also need to create a thumbnail image and st