Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bulk data through JDBC

 
Garg Amit
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have given a file which contains some records (no of records might be in lakhs). Now problem is we have to read the data from this file and then query the database using the data from file. Finally we'd export the data in CSV.

What could be the best way so that we can do this very quick and it should be memory efficient also.

Thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been told before but I forget, what is a lakh?

Usually the best tool for bulk data manipulation is the one supplied with your database, since it will usually allow you to make all sorts of tweeks to aid performance. Which database are you using?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:I've been told before but I forget, what is a lakh?

1 lakh = 100,000; 10^5
Lakh
 
Garg Amit
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using MS SQL server
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use Transact SQL's bulk insert stuff then. Like I said, it will give you much more control over the loading process than normal SQL. See msdn.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic