다음은 준비된 문을 사용하여 이미지에 대한 데이터를 삽입하는 코드 예제입니다.
PreparedStatement statement = getSession().prepare(
"INSERT INTO pixelstore.image " +
"(image_name, " +
" upload_time, " +
" upload_by, " +
" file_type, " +
" file_size" +
") VALUES (?, ?, ?, ?, ?);");
// create the bound statement and initialise it with your prepared statement
BoundStatement boundStatement = new BoundStatement(statement);
session.execute(// this is where the query is executed
boundStatement.bind(// here you are binding the 'boundStatement'
"background", TimeUtil.getTimeUUID(), "lyubent", "png", "130527"));
운전자가 할 수있는 일의 데모와 행성 카산드라에 두 최근 블로그 게시물가 있었다, 그들은 코드 예제를 포함 그래서 그들을 밖으로 검사 :
- Materialized View with Cassandra and DataStax Java Driver
- Small Java Application using DataStax Java Driver and Cassandra 1.2 working
정말 고마워요 !! –