We don't want to provide this out of the box, because logging bound values can introduce security issues (think passwords, etc.).
private static String toStringWithValues(BoundStatement bs, ProtocolVersion protocolVersion) {
PreparedStatement ps = bs.preparedStatement();
StringBuilder details = new StringBuilder(ps.getQueryString() + "\n");
ColumnDefinitions defs = ps.getVariables();
int index = 0;
for (ColumnDefinitions.Definition def : defs) {
DataType type = def.getType();
Object value = type.deserialize(bs.getBytesUnsafe(index), protocolVersion);
details.append("value " + index + " = " + type.format(value) + "\n");
index += 1;
}
return details.toString();
}
In 2.0, bound values are not exposed. If you need them, I'll reopen
JAVA-115 and provide a method for that.