首页 文章

Cassandra在datastax驱动程序中准备了批处理语句

提问于
浏览
4

我在Datastax java驱动程序中使用了以下代码进行批量预处理 .

PreparedStatement ps = session.prepare("INSERT INTO messages (user_id,                                                                      
msg_id, title, body) VALUES (?, ?, ?, ?)");
BatchStatement batch = new BatchStatement();
batch.add(ps.bind(uid, mid1, title1, body1));
batch.add(ps.bind(uid, mid2, title2, body2));
batch.add(ps.bind(uid, mid3, title3, body3));
session.execute(batch);

是否记录了此BatchStatement?

1 回答

相关问题