File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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[].
I agree. Here's the link:
subject: get files from database
It's not a secret anymore!