Skip to content

Commit

Permalink
fix: cleanup unused methods (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Jun 5, 2024
1 parent 4d72c4f commit ad0a35c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void setAsciiStream(int parameterIndex, InputStream value, int length)
parameters.setParameter(parameterIndex, value, Types.VARCHAR, length);
}

@SuppressWarnings("DeprecatedIsStillUsed")
@Override
@Deprecated
public void setUnicodeStream(int parameterIndex, InputStream value, int length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,6 @@ private <T> T doWithStatementTimeout(
}
}

/**
* Executes a SQL statement on the connection of this {@link Statement} as an update (DML)
* statement.
*
* @param statement The SQL statement to execute
* @return the number of rows that was inserted/updated/deleted
* @throws SQLException if a database error occurs, or if the number of rows affected is larger
* than {@link Integer#MAX_VALUE}
*/
int executeUpdate(com.google.cloud.spanner.Statement statement) throws SQLException {
return checkedCast(executeLargeUpdate(statement));
}

/**
* Do a checked cast from long to int. Throws a {@link SQLException} with code {@link
* Code#OUT_OF_RANGE} if the update count is too big to fit in an int.
Expand All @@ -268,18 +255,6 @@ int checkedCast(long updateCount) throws SQLException {
return (int) updateCount;
}

/**
* Executes a SQL statement on the connection of this {@link Statement} as an update (DML)
* statement.
*
* @param statement The SQL statement to execute
* @return the number of rows that was inserted/updated/deleted
* @throws SQLException if a database error occurs
*/
long executeLargeUpdate(com.google.cloud.spanner.Statement statement) throws SQLException {
return doWithStatementTimeout(() -> connection.getSpannerConnection().executeUpdate(statement));
}

/**
* Executes a SQL statement on the connection of this {@link Statement}. The SQL statement can be
* any supported SQL statement, including client side statements such as SET AUTOCOMMIT ON|OFF.
Expand Down

0 comments on commit ad0a35c

Please sign in to comment.