Here is an example of how to get the DATA value from MY_TABLE, which happens to be a BLOB.
var query = "select DATA\n" +
" from MY_TABLE\n" +
" where MY_TABLE_ID = 2"; // TODO: insert your record identifier.
var dbCDA = "";
var connection = qie.getDbConnection(dbName);
var preparedStatement;
try {
// We have to prepare the query to be executed, and get a handle on that query
preparedStatement = connection.prepareStatement(query);
var resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
var inputStream = resultSet.getBinaryStream("DATA");
dbCDA += IOUtils.toString(inputStream, "UTF-8");
}
} finally {
// close the connection to avoid connection leaks
try {
if (preparedStatement !== null) {
preparedStatement.close();
}
} catch (err) {
qie.info("error closing the preparedStatement " + err);
}
connection.close();
}