aspose file tools*
The moose likes JDBC and the fly likes Starting Point for Script that Inserts a Folder of .PDF files into an SQL Server Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Starting Point for Script that Inserts a Folder of .PDF files into an SQL Server Database" Watch "Starting Point for Script that Inserts a Folder of .PDF files into an SQL Server Database" New topic
Author

Starting Point for Script that Inserts a Folder of .PDF files into an SQL Server Database

Jonathan Yanes
Greenhorn

Joined: Mar 08, 2010
Posts: 2
Hello,
I was wondering if anyone could point me in the right direction with some sample code snippets etc, for the following: I want to create a Java Application that runs standalone on a scheduled/cron basis. When it runs it will look at a folder say "reports" and read each .pdf file in that folder and load it into a SQL Server database as Binary data. After each file is done being migrated to the database i want to archive the pdf. Any pointers? Place to start?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Start from the top down. Write a program which looks in a folder and identifies all the PDF files.

You have at least four different questions in that post, five or six maybe depending on how you count. So you really ought to separate the job into its component parts and take care of them one at a time. I've identified the first part above. After that you can change the program so that it actually does something with the PDFs.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Jonathan,
Welcome to JavaRanch!

Since you asked this in the database forum, I'll answer for the JDBC part. Take a look at this tutorial on BLOBs for storing binary data.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jonathan Yanes
Greenhorn

Joined: Mar 08, 2010
Posts: 2
Awesome. Thanks for the reply...i will take a look.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Starting Point for Script that Inserts a Folder of .PDF files into an SQL Server Database