1515 */
1616package com .datastax .oss .driver .api .core .cql ;
1717
18+ import com .datastax .oss .driver .api .core .AllNodesFailedException ;
19+ import com .datastax .oss .driver .api .core .servererrors .QueryExecutionException ;
20+ import com .datastax .oss .driver .api .core .servererrors .QueryValidationException ;
21+ import com .datastax .oss .driver .api .core .servererrors .SyntaxError ;
1822import com .datastax .oss .driver .api .core .session .Request ;
1923import com .datastax .oss .driver .api .core .session .Session ;
2024import com .datastax .oss .driver .internal .core .cql .DefaultPrepareRequest ;
@@ -31,6 +35,17 @@ public interface SyncCqlSession extends Session {
3135 /**
3236 * Executes a CQL statement synchronously (the calling thread blocks until the result becomes
3337 * available).
38+ *
39+ * @param statement the CQL query to execute (that can be any {@link Statement}).
40+ * @return the result of the query. That result will never be null but can be empty (and will be
41+ * for any non SELECT query).
42+ * @throws AllNodesFailedException if no host in the cluster can be contacted successfully to
43+ * execute this query.
44+ * @throws QueryExecutionException if the query triggered an execution exception, i.e. an
45+ * exception thrown by Cassandra when it cannot execute the query with the requested
46+ * consistency level successfully.
47+ * @throws QueryValidationException if the query is invalid (syntax error, unauthorized or any
48+ * other validation problem).
3449 */
3550 @ NonNull
3651 default ResultSet execute (@ NonNull Statement <?> statement ) {
@@ -41,6 +56,17 @@ default ResultSet execute(@NonNull Statement<?> statement) {
4156 /**
4257 * Executes a CQL statement synchronously (the calling thread blocks until the result becomes
4358 * available).
59+ *
60+ * @param query the CQL query to execute.
61+ * @return the result of the query. That result will never be null but can be empty (and will be
62+ * for any non SELECT query).
63+ * @throws AllNodesFailedException if no host in the cluster can be contacted successfully to
64+ * execute this query.
65+ * @throws QueryExecutionException if the query triggered an execution exception, i.e. an
66+ * exception thrown by Cassandra when it cannot execute the query with the requested
67+ * consistency level successfully.
68+ * @throws QueryValidationException if the query if invalid (syntax error, unauthorized or any
69+ * other validation problem).
4470 */
4571 @ NonNull
4672 default ResultSet execute (@ NonNull String query ) {
@@ -110,6 +136,10 @@ default ResultSet execute(@NonNull String query) {
110136 * query strings but different {@linkplain SimpleStatement#getConsistencyLevel() consistency
111137 * levels} will yield distinct prepared statements.
112138 * </ul>
139+ *
140+ * @param statement the CQL query to execute (that can be any {@link SimpleStatement}).
141+ * @return the prepared statement corresponding to {@code statement}.
142+ * @throws SyntaxError if the syntax of the query to prepare is not correct.
113143 */
114144 @ NonNull
115145 default PreparedStatement prepare (@ NonNull SimpleStatement statement ) {
@@ -124,6 +154,10 @@ default PreparedStatement prepare(@NonNull SimpleStatement statement) {
124154 *
125155 * <p>The result of this method is cached (see {@link #prepare(SimpleStatement)} for more
126156 * explanations).
157+ *
158+ * @param query the CQL string query to execute.
159+ * @return the prepared statement corresponding to {@code query}.
160+ * @throws SyntaxError if the syntax of the query to prepare is not correct.
127161 */
128162 @ NonNull
129163 default PreparedStatement prepare (@ NonNull String query ) {
@@ -143,6 +177,10 @@ default PreparedStatement prepare(@NonNull String query) {
143177 *
144178 * <p>The result of this method is cached (see {@link #prepare(SimpleStatement)} for more
145179 * explanations).
180+ *
181+ * @param request the {@code PrepareRequest} to execute.
182+ * @return the prepared statement corresponding to {@code request}.
183+ * @throws SyntaxError if the syntax of the query to prepare is not correct.
146184 */
147185 @ NonNull
148186 default PreparedStatement prepare (@ NonNull PrepareRequest request ) {
0 commit comments