title: Unable to open JDBC Connection for DDL execution with SpringBoot + Postgresql
body: <p>I am creating a Spring Boot application with DB PostgreSQL. My <code>application.properties</code> looks as follow:</p>
  <pre><code>## Spring DATASOURCE (DataSourceAutoConfiguration &amp; DataSourceProperties)
  spring.datasource.url=jdbc:postgresql://localhost:5432/my-db
  spring.datasource.username= myusername
  spring.datasource.password= mypassword
  
  # The SQL dialect makes Hibernate generate better SQL for the chosen database
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
  
  # Hibernate ddl auto (create, create-drop, validate, update)
  spring.jpa.hibernate.ddl-auto = update
  </code></pre>
  <p>The dependencies:</p>
  <pre><code>    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  <p>Simple Model:</p>
  <pre><code>@Entity
  @Table(name = &quot;questions&quot;)
  @Data
  public class Question {
      @Id
      @GeneratedValue(generator = &quot;question_generator&quot;)
      @SequenceGenerator(
              name = &quot;question_generator&quot;,
              sequenceName = &quot;question_sequence&quot;,
              initialValue = 1000
      )
      private Long id;
  
      @NotBlank
      @Size(min = 3, max = 100)
      private String title;
  
      @Column(columnDefinition = &quot;text&quot;)
      private String description;
  }
  </code></pre>
  <p>The Repository:</p>
  <pre><code>@Repository
  public interface QuestionRepository extends JpaRepository&lt;Question, Long&gt; {
  }
  </code></pre>
  <p>And the Controller:</p>
  <pre><code>@RestController
  public class QuestionController {
  
      @Autowired
      private QuestionRepository questionRepository;
  
      @GetMapping(&quot;/questions&quot;)
      public Page&lt;Question&gt; getQuestions(Pageable pageable) {
          return questionRepository.findAll(pageable);
      }
  }
  </code></pre>
  <p>When I tried to run the application, it threw an error:</p>
  <blockquote>
  <p>Caused by: org.hibernate.exception.GenericJDBCException: Unable to
  open JDBC Connection for DDL execution</p>
  <p>Caused by:
  org.postgresql.util.PSQLException: This ResultSet is closed.</p>
  </blockquote>
  <p>Can someone give me a tipp what did I make wrong in the configuration? Thank you so much in advanced!</p>