• Post Reply Bookmark Topic Watch Topic
  • New Topic

streaming to a db  RSS feed

 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I need to read a data file or files and then stream them to a database, which will then process them. I have a few questions.

1. What is the best Instream to use to read the file in? It can be a very large file and is comma delimited text.

2. Do I just use an Outstream to connect to a socket and stream the the data that I got from the Instream? If so what is the best OutStream to use.

3. If this is the right approach do I read in the whole file first and then stream it to the db or do I read a certain amount in stream it right away to the db and continue till the file(s) are done?

Thanks,

AMD
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Tutorial chapter on IO has information on all the various IO streams. For your purposes a plain IOStream would work fine. If your data is small it would be fine to read it all in, then write it all out. What "small" is depends on your application and available resources (RAM).
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank Joe

AMD
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!