• Post Reply Bookmark Topic Watch Topic
  • New Topic

accessing data from a table  RSS feed

 
Chris Kislow
Greenhorn
Posts: 21
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I trying to read about how to access data from a table for example

Table 1 contains:

ID        Min          Max
No        Range    Azimuth
1           0           50
2            1           55


I would like to keep this code easy
I read about parsing, it can get a little complicated
but would that be the best way to store this data into an Object[]
or is there a better way

a second issue would be how to access the second line of data with (No      Range     Azimuth)
would the parsing keep each column together so i could access the word 'Range' for example and then
get the data under that column
thanks
 
Carey Brown
Saloon Keeper
Posts: 3315
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the source of this table? Text file? Swing interface? User entered?
Do you have a class yet for storing a row of data?
 
Chris Kislow
Greenhorn
Posts: 21
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:What is the source of this table? Text file? Swing interface? User entered?
Do you have a class yet for storing a row of data?


it is a text file and no class yet
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the tabular data is as simple as you've posted, I would lookup csv file and study it a bit.  You'll run into it often.  It can be parsed as easily as this: CSV stands for Comma Separated Values but you can use any separator.  Often a tab is used.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!