Skip to content

Commit e96a86a

Browse files
authored
fix: ClassCastException in Spring Data JDBC sample (#1595)
1 parent f54beb2 commit e96a86a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
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)