• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Geting row

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to get full record of one row and want to save it in vector
then display it in table how can do that please help
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nabi bux:
i want to get full record of one row and want to save it in vector
then display it in table how can do that please help



May be you should have a look at JDBC Tutorial.

To give you brief idea about the process:

1. Register JDBC Driver
2. Get Connnection
3. Create Statement
4. execute statement using required SQL. This will return ResultSet.
5. Create an instance of Vector
5. Iterate over ResultSet, retrive all values of given record, put them in a custom Value Object (VO). Add VO to Vector. (You have to write this VO class as per your requirement)
6. Close ResultSet, Statement and Connection.

Use Vector to display values wherever you want.

Regards,
Jass
[ May 01, 2006: Message edited by: Jass Singh ]
 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply have all these funtion complede and working very
but whwn i rs.next() function
then how i get full row
not individual record such as rs.getObject(1) etc
which functon i use to get full row record not individual
column thank iam waitinng for you r positive resonse
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is now resultset method to retrieve the entire row. use a simple
for loop and the vector add() method to convert the row to a vector.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic