wood burning stoves*
The moose likes JDBC and the fly likes Finding element at a particular row in a column. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Finding element at a particular row in a column." Watch "Finding element at a particular row in a column." New topic
Author

Finding element at a particular row in a column.

Ankit Tripathi
Ranch Hand

Joined: Oct 17, 2009
Posts: 198
Hi all,
I have found a element at the cross of a particular row at a particular column.For Ex.at the cross of 3rd column and 2nd row.
Now how I can find other element in some other column at same row no?

I can find a particular element in ResultSet and row no. of that element one-by-one like that-



Now I am not getting how to find an element at same row index in some other column...
Ankit Tripathi
Ranch Hand

Joined: Oct 17, 2009
Posts: 198
Can sonebody please look here.....
prateek sharmaa
Ranch Hand

Joined: May 15, 2010
Posts: 38
hi ankit,

you can do following two things :

// Get the data from the row using the column index
String s = rs.getString(1);

// Get the data from the row using the column name
s = rs.getString("col_string");

if you know the next column number then you can use the first option or if you know the next column name you want to fetch then you can use the second option.

thanks,
pratz

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Finding element at a particular row in a column.
 
Similar Threads
How to Display a JTable with the Data
checking for neighbours in array
Deleting a row dynamically
How to update a row in view if i sort a column in my model?
Printing multi-dimesonial arrays