You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
PreparedStatement.executeUpdate() currently does not work for DDL statements, and throws an exception. It should execute it successfully and return 0 as the result. (Ref)
String DDL = "CREATE TABLE FOO (ID INT64 NOT NULL, NAME STRING(100)) PRIMARY KEY (ID)";
try (PreparedStatement pstmt = connection.prepareStatement(DDL)) {
int updateCount = pstmt.executeUpdate();
assertEquals(updateCount, 0);
}
The above fails with the exception com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: Statement is not an update statement: CREATE TABLE FOO (ID INT64 NOT NULL, NAME STRING(100)) PRIMARY KEY (ID).
PreparedStatement.executeUpdate()currently does not work for DDL statements, and throws an exception. It should execute it successfully and return 0 as the result. (Ref)The above fails with the exception
com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: Statement is not an update statement: CREATE TABLE FOO (ID INT64 NOT NULL, NAME STRING(100)) PRIMARY KEY (ID).