*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "get files from database" Watch "get files from database" New topic
Author

get files from database

Bobes Calin
Greenhorn

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
Greenhorn

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[].
 
Don't get me started about those stupid light bulbs.
 
subject: get files from database
 
Similar Threads
send files over the socket
ORA-01460: unimplemented or unreasonable conversion requested
BLOB and CLOB
Data type mapping issue
servlet image upload issue