AEM 6.5 inserting PDF document in a table's Blob column | Adobe Higher Education
Skip to main content
Level 5
January 4, 2022
Respondido

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

  • January 4, 2022
  • 1 resposta
  • 871 Visualizações

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

Este tópico foi fechado para respostas.
Melhor resposta por workflowuser

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

1 Resposta

workflowuserAdobe EmployeeResposta
Adobe Employee
January 4, 2022

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

Level 5
January 4, 2022

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

~Leena