Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to download a pdf file stored in a MySQL blob?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default How to download a pdf file stored in a MySQL blob?

    I want to know what should I put inside a jbutton action listener.

    I think I knew how to get the row in the table where the blob file exists

    and place the Blob file into a variable

    Blob pdffile = rs.getBlob(6)

    the problem is i don't know what to do with the pdffile(blob) to save it in a local directory


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,308
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: How to download a pdf file stored in a MySQL blob?

    See the API for Blob, in particular the getBinaryStream() method, which retrieves an InputStream

Similar Threads

  1. How to Download a file via FTP
    By JavaPF in forum Java Networking Tutorials
    Replies: 1
    Last Post: December 24th, 2011, 10:56 AM
  2. Download a file by Bluetooth in Java SE
    By danielpereira in forum Java Theory & Questions
    Replies: 0
    Last Post: October 6th, 2010, 02:37 PM
  3. Download File from Mysql database
    By Puk284 in forum Java Servlet
    Replies: 0
    Last Post: April 24th, 2010, 07:43 AM
  4. How to Download a file via FTP
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: June 5th, 2009, 05:49 AM
  5. Detecting File Download Completion
    By fedfan in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: June 5th, 2009, 04:27 AM