File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Geting row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Geting row " Watch "Geting row " New topic
Author

Geting row

nabi bux
Ranch Hand

Joined: Mar 14, 2005
Posts: 73
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

Joined: Mar 30, 2006
Posts: 52
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

Joined: Mar 14, 2005
Posts: 73
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

Joined: Mar 02, 2006
Posts: 196
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Geting row