This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Java in General
reading from a .data file
Joined: Jun 22, 2012
Feb 15, 2013 11:41:25
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
Any idea, please?
Joined: Oct 02, 2003
Feb 15, 2013 12:21:01
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.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Jun 22, 2012
Feb 15, 2013 13:26:42
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
Joined: Sep 13, 2007
Feb 15, 2013 21:01:55
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?
Joined: Aug 13, 2013
Aug 13, 2013 10:40:21
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?
I agree. Here's the link:
subject: reading from a .data file
Descending order and associating Array Elements in sort method to another's elements
CSV file structure Validation
Hadoop and compression
NX: flexibility of database definition
use diffrent servlet values (how to unload a servlet)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014