to Dien Truong Thanh: ID field in table Student is not identity and also not auto increment. I can't use getSelectedIndex() method to get ID field to Retnuh: setListData method of JList doesn't support set Map interface , it only support vector or Object array
On Dec 20, 10:45 pm, chim chich bong <[email protected]> wrote: > I have a JList object and a vector object contain values in Student > table. But when i set value on Jlist object, i only set studentName > column.I want to get primary key when i select item on Jlist. > ex: > stStudent = cn.createStatement(); > rsStudent = stStudent.executeQuery("select ID,(lastName + > ' ' + firstName) StudentName from Student"); > Vector vtStudent = new Vector(); > > while(rsStudent.next()){ > vtStudent.add(rsStudent.getObject(2)); > } > listStudent.setListData(vtStudent); > > i want get value of ID field when select item on listStudent object -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
