This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "get files from database" Watch "get files from database" New topic

get files from database

Bobes Calin

Joined: Nov 13, 2008
Posts: 14
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
Similar Threads
send files over the socket
ORA-01460: unimplemented or unreasonable conversion requested
Data type mapping issue
servlet image upload issue