954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to save a file in database and get the content from that file(using java)

.

julia07
Newbie Poster
3 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

u can save file in data base as binary data type.

DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 

i want upload resume into the database and get content from that resume after saving.is it possible?

julia07
Newbie Poster
3 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

you can upload the file and also can retrieve the whole file from database.
but if you want to retrieve some content or field then save the content of file in multiple fields

DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 
you can upload the file and also can retrieve the whole file from database. but if you want to retrieve some content or field then save the content of file in multiple fields


then help me in the coding using java

julia07
Newbie Poster
3 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 
DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 

Without knowing what you actually want to do, you should not even think about hacking out some code...
First get those specs down on paper, so you actually know what you're talking about.

So again, do you want to store the actual file or do you want to parse the content of the file in some way and store the data contained in it?
The first is easy, the second can be easy or hard depending on the file format and layout.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
.


Files can be saved in database inform of stream. I.e You first of all convert the file to an inputstream or a byte array them save the content in a column (as a field) of a table in a database.
When saving this file ensure to save the file extension in another column as this will help you load an application capable of reading it when displaying it as an output

couama
Newbie Poster
1 post since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You