Skip to content

Commit 1408060

Browse files
authored
fix: ClassCastException in Spring Data JDBC sample (googleapis#1595)
1 parent 5994c09 commit 1408060

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • java-spanner-jdbc/samples/spring-data-jdbc/src/main/java/com/google/cloud/spanner/sample

java-spanner-jdbc/samples/spring-data-jdbc/src/main/java/com/google/cloud/spanner/sample/JdbcConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static boolean isCloudSpannerPG(JdbcOperations operations) {
6464
"The selected Cloud Spanner database does not use the PostgreSQL dialect");
6565
} catch (DataAccessException exception) {
6666
if (exception.getCause() instanceof JdbcSqlException) {
67-
JdbcSqlException jdbcSqlException = (JdbcSqlException) exception;
67+
JdbcSqlException jdbcSqlException = (JdbcSqlException) exception.getCause();
6868
if (jdbcSqlException.getCode() == Code.PERMISSION_DENIED
6969
|| jdbcSqlException.getCode() == Code.NOT_FOUND) {
7070
throw new RuntimeException(

0 commit comments

Comments
 (0)