Astyanax支持cql 3准备好的语句吗?

时间:2012-10-10 19:14:19

标签: astyanax cql3

我知道cassandra可以做但Astyanax呢?它是否会逃避值中的单引号? THX

1 个答案:

答案 0 :(得分:0)

是的,

您可以在此处查看示例https://github.com/Netflix/astyanax/wiki/Cql-and-cql3

final String INSERT_STATEMENT = "INSERT INTO employees (empID, deptID, first_name,   last_name) VALUES (?, ?, ?, ?);";

result = keyspace
    .prepareQuery(CQL3_CF)
        .withCql(INSERT_STATEMENT)
    .asPreparedStatement()
        .withIntegerValue(222)
        .withIntegerValue(333)
        .withStringValue("Eric")
        .withStringValue("Cartman")
    .execute();