• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting Column index

 
Seema Hanji
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is it possible to get column index from ResultSetMetaData ? I didn't see any methods for that...
Thanks,
seema
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do u mean the coloumn index?
u mean u supply the name and u get the index number??
it usually works the other way around.
u have all the coloumns and u want to know their names.
 
Seema Hanji
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my code, I need to call metadata.getColumnDisplaySize(i);
This method takes column index, at this point I know column name not the index. So can I pass columnname and get column index from metadata ?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not that I am aware of.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"SeemaH",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please re-register and select a new name which meets the requirements.
Thanks.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic