AEM 6.5 inserting PDF document in a table's Blob column | Community
Skip to main content
Level 5
Jan 4, 2022 8:40 PM UTC
Solved

AEM 6.5 inserting PDF document in a table's Blob column

Hi,

I have a custom bundle/code that converts the submitted XML data and XDP template into a PDF document, when an user fills in the form and submits it. The com.adobe.aemfd.docmanager.Document is used to generate this PDF file. 

The code contains Oracle prepared statement that stores the form's name and xdp name. This is working fine. 

I like to add/insert the PDF file in the table. The table is altered to include the Blob column.

The code ps.setBlob(3, generatedPDF); is generating the following error:

The method setBlob(int, Blob) in the type PreparedStatement is not applicable for the arguments (int, Document)

How to cast the document argument to type Blob?

Thanks,

Leena

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
workflowuserAccepted solution
Employee
Jan 4, 2022 8:45 PM UTC

ps.setBlob(3,generatedPDF.getInputStream());

2 replies

workflowuserAccepted solution
Employee
Jan 4, 2022 8:45 PM UTC

ps.setBlob(3,generatedPDF.getInputStream());

Translate
Level 5
Jan 4, 2022 8:57 PM UTC

Thank you for the quick response. I think this resolved the type casting problem. 

~Leena

Translate