• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading from a .data file

 
Isaac Ferguson
Ranch Hand
Posts: 844
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have read the files (Person.data and Order.data) and populate the tables (PERSON and ORDER).

In the files I have data like "1, Angus, Scott, Rozel, Bristol " in the PERSON file. And 1|2 in the ORDER file

Then I need populate tables in a DB using JDBC.

Any idea, please?

Thanks
 
fred rosenberger
lowercase baba
Bartender
Posts: 12144
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a fairly broad question. Those are usually met with broad answers. such as

1) read the first file
2) parse the data
3) insert into database
4) read second file
5) parse the data
6) insert into database.

Do you have SPECIFIC questions you need help with? There are so many ways to interpret what you wrote that it is really impossible to give you any meaningful help.
 
Isaac Ferguson
Ranch Hand
Posts: 844
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have parsed the data I can show it in my console from the file.

Teh data is like this

1, Angus, Scott, Rozel, Bristol

I need dinamically every value in a different field in my table.

In my case I have

PERSON [ PERSON_ID (Primary Column), LAST_NAME, FIRST_NAME, STREET, CITY ]in the database.

Then I need set in ERSON_ID (Primary Column) -->1 ,etc

Any idea?

Thanks

 
K. Tsang
Bartender
Posts: 3457
14
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you said you can read the file in code. The next step would be to parse it into the proper fields. Are all lines comma-separated? How would you split it up?
 
Charles Karlnesky
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
I am curious how can you read Person.data file? I mean by .data at the end you mean it could be .txt file? My question is, what is a file with a .data extension?
Best wishes,
Tage
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic