title: How to Store doc, jpeg, pdf files in postgreSQL using java
body: <p><strong>In a web application I want to store all doc, jpeg, pdf files in postgreSQL database.</strong> 
  I know it can also be done by storing it on file system and storing its path in db, but I am not looking for that solution.  I want to know following things:</p>
  
  <ol>
  <li>What should be data type for a table.</li>
  <li>Does it maintain formatting of doc ?</li>
  <li>And how storing it in postgreSQL can be achieved using java, hibernate technology. IS it required to create nativeSQL query? </li>
  </ol>
  
  <p>Any pointers for this issue will be helpful.</p>