springboot app connects to postgres even db server is disconnected

I have a springboot app that connects to PostgreDB. here is the datasource bean

@Bean
public DriverManagerDataSource createDataSourceBean(Environment env) {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.postgresql.Driver");
    dataSource.setUrl("jdbc:postgresql://localhost:5432/postgres");
    dataSource.setUsername("postgres");
    dataSource.setPassword("<myspassword>");    

    return dataSource;
} 

This works fine, but I wonder why even if I try to disconnect the database server via pgAdmin and then run the app my app still works. I believe I should encounter an exception when dbserver is disconnected.

I'm sure there's something weird happening . . .