Load cql script file programatically using Datastax Java API

775 views
Skip to first unread message

SathishKumar Alwar

unread,
Sep 19, 2016, 6:02:40 PM9/19/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

I am new to Cassandra. I have come up with a cql file which consists of CQL commands like

CREATE TABLE,
CREATE TYPE,
INSERT INTO

I am able to execute the commands in this file via 

cqlsh -f a.cql 

or by running 

source a.cql

after logging into cql shell

Could you please let me know whether Datastax driver provides API to perform this operation programatically.

Thanks and Regards
A.SathishKumar

Olivier Michallat

unread,
Sep 19, 2016, 6:42:39 PM9/19/16
to java-dri...@lists.datastax.com
Hi,

There is no such utility in the Java driver at this time. You'd need to split the script yourself and feed individual statements to Session.execute.

--

Olivier Michallat

Driver & tools engineer, DataStax


--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

SathishKumar Alwar

unread,
Sep 20, 2016, 6:23:13 PM9/20/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Olivier,

Thanks for your prompt response. 

Thanks and Regards
A.SathishKumar
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages