Link to home
Start Free TrialLog in
Avatar of alpjose
alpjose

asked on

Storing data from a XML file for processing

Hello,

     I am getting some data in VOTable form or equivalent to XML form, using SAVOT parser, the file is parsed and it is getting printed on the console.

The data is in the form of tables where the rows contains the Name = value pair data.

i want to store these values and later retrieve them for further processing. the data varies depending on the query, sometimes there are many number of tables, and all the data has to be stored .

I am planning to use JTable,

Is there any other way to achieve the above,

thanks & regards
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

If all the rows are just a name and value pair then you could use classes that are designed for holding information like this, like HashTable or Properties, or even just a simple Array.

The main issue is whether the name part of the name value pair will be unique.

When you say you want to "store" them do you mean just hold them or actually persist/write them to disk ?

Also, unless you want to display the data in a graphical Table then JTable is probably overkill. You could just use a TableModel (the underlying storage class of JTable)if all you want to do is hold the data.
Avatar of CEHJ
If you can, and are, going to use a table-like structure in which to store the name value pairs, then of course the name will be redundant for storage purposes as it will represent a column name.

How are the name\value pairs returned - as a String? As in:

key=value
ASKER CERTIFIED SOLUTION
Avatar of doddjames
doddjames

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alpjose
alpjose

ASKER

Thanks doddjames , it is working.