Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #362
| From | "Ameen" <ameen@THRWHITE.remove-dii-this> |
|---|---|
| Subject | How to output record data |
| Message-ID | <5c4e18c0-655b-467b-abae-4febb31624fd@k1g2000prb.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.databases |
| Date | 2011-04-27 15:23 +0000 |
| Organization | TDS.net |
To: comp.lang.java.databases I have mysql database has Nationality table of ID and Name fields. In my Java application I am using entityManager to run a named query and get the result as List, as follow: // em is the entityManager. // Nationality.getAllRecord is a named query created in Nationality Entity Class, // it only selects all record from Nationality table. List qresult =3D em.createNamedQuery (=93Nationality.getAllRecord=94).getResultList(); It works fine and gets all the records. Even when I output the size of result List using qresult.size() it gives the correct result. Just I have one problem that is, how to output the data of each record fields. I know that each qresult List item represent a record, and I can get the specific record I need using qresult.get(int index) function but how to reach the fields/column in a particular record . I searched the Internet but I couldn't find any single example showing that. Can any one help me please? --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.databases | Previous | Next — Next in thread | Find similar
How to output record data "Ameen" <ameen@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: How to output record "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: How to output record "Donkey Hottie" <donkey.hottie@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
csiph-web