martedì 9 agosto 2011

Reading PDF file in Java

Usually, in our work as developers, we are asked to create PDF files using java and in this I recommend the use of library iText.
Today, instead we want to read data from a PDF file that have a copy protection to make sure you cannot copy-paste any content from the PDF. 
I try Apache PDFBox  , and with a few rows of code, I'm able to read content of PDF file. 

lunedì 1 agosto 2011

Java SQL Script Insert Creator

This little java program was born to respond to the challenge of copy the content of db2 table in "sql-form'.
I usually use SQuirrel SQL Client for data access to sql tables. SQuirrel permits to create sql script starting from table using "Script -> Create Data Script". Unfortunately, perhaps due to performarce of my computer, for table with over of seventy thousand rows (70000) this feature doesn't work well (and with acceptable time).

At this time, I test the program over DB2 9.5 on Z\OS and with MySql 5.5 on Windows XP/Vista

1. Double click on JsqlInsertCreator01.jar (as you can see, inside the directory it creates a jsqli.log)
2. Choose database type (DB2 or MySql)
3. Choose DBName, Server (localhost if locale db), port number, user, password , schema and table name
4. Choose the directory where you want to save the file .sql
5. Press "GO" for start the script.

Version 0.4
Add support for Oracle database

Version 0.3
Add support for column type DateTime

Version 0.2
Add developer name

Version 0.1
It does not support tables with BLOB column

An example with MySQL 5.5 (no-install version) on windows vista. I use the database "TEST" and create one table "MY_EXAMPLE_TB". Then I insert two rows.


After JSQLInsert Creator "in action". 

DOWNLOAD (4.28 MB) su DataFileHost