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 4 of 4

Thread: how to write data to a pdf file which is stored on a sql database

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to write data to a pdf file which is stored on a sql database

    Good night,
    First time joining a forum.
    I have a Group Project for an Object Oriented Programming class,basically we have to create a program that helps student with advisement.
    We're using Netbeans and MySQL. The Database has all the courses available and students have to choose which courses they completed and the ones that are still pending. What I want to know is how can I write that information from the database to a pdf file without hard coding it. Is it a query i have to do or queries and where can I get those commands. Sorry for writing so much.
    Thanks for your help


  2. #2
    Forum VIP
    Join Date
    Jun 2011
    Posts
    317
    My Mood
    Bored
    Thanks
    47
    Thanked 89 Times in 74 Posts
    Blog Entries
    4

    Default Re: how to write data to a pdf file which is stored on a sql database

    Are you asking how to dynamically write contents to the PDF file or are you asking how to store a PDF in your database (storing a PDF as a blob in your database is not going to be an issue so I assume it is the former).

    Read up on SQL queries if it is the database side of things. You will need to at least get to the stage where you compile a program that connects to the database and SELECT's a record from the database and prints out the fields. The exact statement will depend on the structure of the database and the info you need from it.

    Dynamically writing contents to a PDF file is a pain. Especially if it is an existing PDF file you wish to modify. Check out some of the libraries and pick an API which does what you need. I would suggest you experiment creating/writing to a new PDF then develop a template which has all the fields you will require.

    As for not needing to hard code anything in a OO programming course... Good luck with that.

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how to write data to a pdf file which is stored on a sql database

    As for the creating pdf part you might like to take a look at iText

  4. #4
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: how to write data to a pdf file which is stored on a sql database

    As for not needing to hard code anything in a OO programming course... Good luck with that.
    - indeed


    oh hmmm, how about ireports, jasperreports? it is capable of generating reports, RTF formats such as PDF's (correct me if im wrong), i only use these in Report viewing on my last project. Im not that sure about it on generating PDF files

Similar Threads

  1. How to write data to file Java ME cldc 1.1 midp 2.0
    By KamilBek in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: November 5th, 2011, 04:18 AM
  2. How to download a pdf file stored in a MySQL blob?
    By A4Andy in forum JDBC & Databases
    Replies: 1
    Last Post: October 20th, 2011, 11:35 PM
  3. how to write code using servlets, jsp and mysql database
    By bvn456 in forum Java Theory & Questions
    Replies: 4
    Last Post: June 28th, 2011, 01:51 PM
  4. Using jbutton to write to jtextfield values to database
    By Sociopath in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 23rd, 2011, 10:53 PM
  5. Any way to write html form data to file?
    By nathan.fortier@gmail.com in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: January 14th, 2011, 03:03 PM