The TdL for LiveCycle ES2 doesn't have the xLOB sample, but for
completeness it is here: http://www.adobe.com/devnet/livecycle/tourdelivecycle/
TdL has several samples and how tos.
Jeff Yates
Avoka Technologies
www.avoka.com
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.sql.DataSource;
import javax.naming.InitialContext;
int processId = patExecContext.getProcessDataIntValue("/process_data/
@id");
InitialContext context = new InitialContext();
Connection connection = ((DataSource)context.lookup("java:/
IDP_DS")).getConnection();
String queryQuery = "select bigdocument, bigstring from
tb_pt_workwithxlobs where process_instance_id = ?";
PreparedStatement queryStatement =
connection.prepareStatement(queryQuery);
try {
queryStatement.setInt(1, processId);
ResultSet results = queryStatement.executeQuery();
results.next();
java.sql.Blob documentBlob = results.getBlob(1);
com.adobe.idp.Document document = new
com.adobe.idp.Document(documentBlob.getBinaryStream());
patExecContext.setProcessDataValue("/process_data/@NewBigDocument",
document);
java.sql.Clob stringClob = results.getClob(2);
patExecContext.setProcessDataValue("/process_data/@NewBigString",
stringClob.getSubString(1L, (int)stringClob.length()));
} catch(Exception ex) {
ex.printStackTrace();
}
queryStatement.close();
connection.close();
The "NewBigDocument" process variable is type "Document" and
"NewBigString" process variable is type "string" with unlimited
length.
Hope that helps.
Jeff Yates
Avoka Technologies
www.avoka.com
On Feb 18, 5:16 pm, "Jeff Yates, Sr. Technical Architect, Avoka.com"
<jya...@avoka.com> wrote:
> There may be more than one way to do this, I used an ExecuteScript
> component to use JDBC. My company created the "how to" on reading and
> writing LOB data in the Tour de LiveCycle, which you can get here:http://download.macromedia.com/pub/developer/livecycle/TourDeLiveCycl...