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 | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Connection closed error while executing query with Spring JDBC Template

    Stack Overflow | 6 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