• Post Reply Bookmark Topic Watch Topic
  • New Topic

Readin a txt file to populate into the database

 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Does anyone knows how or where I can find information of how I can read a file and get this file to populate the database??

I know the part of opening a file to read and to do updates to database but How do I get the exaclty data in the txt file to go into the right columns into the table??

Can anyone point me to the right direction please?

Do I have to use StringTokenizer??

thanks
 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you to use some class of java.util.*; package.
for example ArrayList

You must have in mind that you can use a dynamic array to get and store
your data (remember pointers?) but you have to separate your records of text file with a
specific character or *nextline* mark.

But if you wanna put these values to the right columns, is your job...
I 've worked on a project that needed excacly the same thing.
I have developed a data migration api for my company, and i'm telling you , i had many problems.This code isn't pretty easy, so have courage if you're beginner on algorithm methods.

You need a dynamic array, and keep in mind the data-types...

Farewell!

 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nick!

Sounds like good news!! I have no choice but to do, as this is for work and we are in the fase of testing!!

Have no ideia how Am I going to do that but It makes sense to use an arrray to read the lines of the txt and to separated with new line/?

Now! I heard that I will have to create kind of special characters to marks it line of the txt file to go to the right columns? Is that right?

Anyway I will post my code soon here if I have any problems which I problem will have . This isnt a job for a newbie but kind enjoying the challenge.

Thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!