Skip to content

Commit

Permalink
update javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewang526 committed Sep 17, 2021
1 parent 9e567fe commit 54f0826
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
Expand Up @@ -775,11 +775,6 @@ public int hashCode() {
* .setUseQueryCache(true)
* .build();
* Connection connection = bigquery.createConnection(connectionSettings);
* try {
* connection.executeSelect("SELECT 1");
* } catch (BigQuerySQLException ex) {
* // handle exception
* }
* }
* </pre>
*
Expand Down
Expand Up @@ -40,17 +40,39 @@ public interface Connection {
BigQueryDryRunResult dryRun(String sql) throws BigQuerySQLException;

/**
* Execute a SQL statement that returns a single BigQueryResultSet
* Execute a SQL statement that returns a single ResultSet
*
* <p>Example of running a query.
*
* <pre>
* {
* &#64;code
* // ConnectionSettings connectionSettings =
* // ConnectionSettings.newBuilder()
* // .setRequestTimeout(10L)
* // .setMaxResults(100L)
* // .setUseQueryCache(true)
* // .build();
* // Connection connection = bigquery.createConnection(connectionSettings);
* String selectQuery = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
* try (ResultSet rs = connection.executeSelect(selectQuery)) {
* while (rs.next()) {
* System.out.printf("%s,", rs.getString("corpus"));
* }
* } catch (BigQuerySQLException ex) {
* // handle exception
* }
* }
* </pre>
*
* @param sql a static SQL SELECT statement
* @param options JobOptions in case a query job is created for this query
* @return a BigQueryResultSet that contains the data produced by the query
* @return a ResultSet that contains the data produced by the query
* @exception BigQuerySQLException if a database access error occurs
*/
ResultSet executeSelect(String sql) throws BigQuerySQLException;

/**
* Execute a SQL statement with query parameters that returns a single BigQueryResultSet
* Execute a SQL statement with query parameters that returns a single ResultSet
*
* @param sql typically a static SQL SELECT statement
* @param parameters named or positional parameters. The set of query parameters must either be
Expand All @@ -61,8 +83,7 @@ public interface Connection {
* contain lowercase letters, numeric characters, underscores and dashes. International
* characters are allowed. Label values are optional. Label keys must start with a letter and
* each label in the list must have a different key.
* @param options JobOptions in case a query job is created for this query
* @return a BigQueryResultSet that contains the data produced by the query
* @return a ResultSet that contains the data produced by the query
* @exception BigQuerySQLException if a database access error occurs
*/
ResultSet executeSelect(String sql, List<QueryParameter> parameters, Map<String, String> labels)
Expand Down

0 comments on commit 54f0826

Please sign in to comment.