On Wed, Aug 28, 2013 at 4:01 AM, Vassilis Bekiaris <bekiarisv@iconplatforms.com> wrote:
Hi,

I think the introductory paragraphs in the Java Driver documentation [1] provide good justification on the use of prepared statements:

" ... but you can also use prepared statements, which only need to be parsed once by the cluster, and then bind values to the variables and execute the bound statement you read or write data to a cluster.

In the previous tutorial, you added a loadData method which creates a new statement for each INSERT, but you may also use prepared statements and bind new values to the columns each time before execution. Doing this increases performance, especially for repeated queries."

Cheers!

[1] http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html



I think PreparedStatements should almost always be the recommended way (no stringification, performance, etc.).  Except maybe statements that you are sure they'll be run only once,

:- a)


Alex Popescu
@al3xandru