Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Geting row

 
nabi bux
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Jass Singh
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Martin Simons
Ranch Hand
Posts: 196
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic