944,116 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 11203
  • Java RSS
Aug 13th, 2007
0

save file to database

Expand Post »
Hi,
I want to save a .txt file into database using java language, how can it is possible ?

The .txt file has one word per line and I would like when the program find a string like "<P>" to continue until line with "</P>". If it is found to increase a counter .

Any ideas?

Thank you
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
katerinaaa is offline Offline
11 posts
since May 2007
Aug 13th, 2007
0

Re: save file to database

Click to Expand / Collapse  Quote originally posted by katerinaaa ...
Hi,
I want to save a .txt file into database using java language, how can it is possible ?
You can save it as a String (VARCHAR) or CLOB. That depends on what you want to store.

Quote ...
The .txt file has one word per line and I would like when the program find a string like "<P>" to continue until line with "</P>". If it is found to increase a counter .
That's got nothing to do with saving the data or the file. You could make use of a HTML parser or a regex (if there is an obvious pattern to it).
Reputation Points: 48
Solved Threads: 7
Posting Whiz
aniseed is offline Offline
353 posts
since Apr 2006
Aug 14th, 2007
0

Re: save file to database

Actually I want to make some searches and for this reason and because of file length I think that is better to save text into database.

Searches like find the 10th, 100th word of text.
Which word appears more times...
Which two words appears more times in text . ..
etc

But I don't know how could it be better...

Do you think that I have to save the text like string?
Are there any sites for this or a little more help.

Thanking you in advance
Reputation Points: 10
Solved Threads: 0
Newbie Poster
katerinaaa is offline Offline
11 posts
since May 2007
Aug 14th, 2007
0

Re: save file to database

Click to Expand / Collapse  Quote originally posted by katerinaaa ...
Actually I want to make some searches and for this reason and because of file length I think that is better to save text into database.

Searches like find the 10th, 100th word of text.
Which word appears more times...
Which two words appears more times in text . ..
etc

But I don't know how could it be better...

Do you think that I have to save the text like string?
Are there any sites for this or a little more help.

Thanking you in advance
I think it's better to save every paragraph as a different insert in a table.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
katerinaaa is offline Offline
11 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: two dimensional arrays
Next Thread in Java Forum Timeline: JList DefaultListModel ClassCastException





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC