This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes get files from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "get files from database" Watch "get files from database" New topic

get files from database

Bobes Calin

Joined: Nov 13, 2008
Posts: 22
Hello! I want to make a litle backup tool in java.I made a sample java class that stores files in mysql database:

The save_files table look like this:

i can put files in the database.

The problem is how can i get the files out from the database? did i made a good choice to store the files into a database?

Thakyou, Calin
Dragan Jovanovic

Joined: Feb 07, 2008
Posts: 15
Of course you can read it.
Just make a select statement, retrieve it to ResultSet object, and you can access that blob with ResultSet.getBytes() method. It returns byte[].
wood burning stoves
subject: get files from database
It's not a secret anymore!