• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the file name and its data type?  RSS feed

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

I am planning to write a method which a parameter of tableName(String type) will be passed in and will return a vector. That vector's element is a record which is a String array. To realize that function, I need: 1.to get the table's fileds count which is the length to initial array; 2. the first, second ... the n th filed name; 3. the type of the first, seconde...the n the filed.
Could you help me please?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the following code to get number of fields, each field name and each field type in the table.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!