Skip to content

Instantly share code, notes, and snippets.

@adilfulara
Last active August 29, 2015 13:56
Show Gist options
  • Save adilfulara/8944508 to your computer and use it in GitHub Desktop.
Save adilfulara/8944508 to your computer and use it in GitHub Desktop.
@Test
public void testTableInsert() {
String query = "create table test.user (username text primary key,first text, last text);";
session.execute(query);
Insert insert = QueryBuilder
.insertInto(KEYSPACE_NAME, TABLE_NAME)
.value("username", "jdoe")
.value("first", "John")
.value("last", "Doe");
System.out.println(insert.toString());
ResultSet result = session.execute(insert.toString());
System.out.println(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment