org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.

Stack Overflow | Darshan Mehta | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Connection closed error while executing query with Spring JDBC Template

    Stack Overflow | 7 months ago | Darshan Mehta
    org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.

    Root Cause Analysis

    1. org.springframework.jdbc.support.MetaDataAccessException

      Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.

      at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData()
    2. Spring Framework
      JdbcTemplate.query
      1. org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:305)
      2. org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:329)
      3. org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:214)
      4. org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:134)
      5. org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:97)
      6. org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:99)
      7. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:660)
      8. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695)
      9. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:727)
      10. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
      11. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:787)
      11 frames