• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreparedStatement, setBinaryStream, and outOfMemoryError

 
Hans Solo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to load very file files into a mysql db, and I'm frustrated. I set up a prepared statement, used setBinaryStream to input the file, and executed only to have the outOfMemoryError bite me.

My understanding given the javadoc is that using the setBinaryStream method will allow me to basically stream the file in rather than holding the entire thing in memory. I point at this line... "The data will be read from the stream as needed until end-of-file is reached"
in the javadoc

Here is the relevant code snippet.



What am I missing here?
 
Hans Solo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should point out that the DB in question is MySQL. I believe that may be the problem, but I can't verify it past my assumption that the fault lies there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic