incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <jacob.rho...@me.com>
Subject Re: Using "IN" with the Datastax driver (2.0-??)
Date Mon, 10 Feb 2014 23:18:49 GMT
Perfect, thanks! I wonder if this is documented anywhere? Certainly I have no idea how to search
google using the keyword β€œin” :D

    String[] words = TagsToArray.tagsToArray(keyword.toLowerCase());
    PreparedStatement p = api.getCassandraSession().prepare("select log_entry from log_index
where keyword in ?");
    session.execute(p.bind(Arrays.asList(words))));

Thanks,
Jacob

On 11 Feb 2014, at 9:55 am, DuyHai Doan <doanduyhai@gmail.com> wrote:

> Hello Jacob,
> 
>  You can try the bind marker for variadic param (new feature):
> 
> PreparedStatement p = session.prepare("select log_entry from log_index where keyword
IN ?”);
> 	session.execute(p.bind(Arrays.asList("keyword1","keyword2",...));
> 
> Regards
> 
>  Duy Hai DOAN
> 


Mime
View raw message