SqlHandler { Connection getConnection() throws SQLException { return this.dataSource.getConnection(); } SqlHandler(InternalCache cache, String regionName,
      TableMetaDataManager tableMetaDataManager, JdbcConnectorService configService,
      DataSourceFactory dataSourceFactory);  SqlHandler(InternalCache cache, String regionName,
      TableMetaDataManager tableMetaDataManager, JdbcConnectorService configService); PdxInstance read(Region<K, V> region, K key); void write(Region<K, V> region, Operation operation, K key, PdxInstance value);  }
@Test public void handlesSQLExceptionFromGetConnection() throws Exception { doThrow(new SQLException("test exception")).when(dataSource).getConnection(); assertThatThrownBy(() -> handler.getConnection()) .isInstanceOf(SQLException.class).hasMessage("test exception"); }
@Test public void createSqlHandlerHandlesSqlExceptionFromGetConnection() throws SQLException { doThrow(new SQLException("test exception")).when(dataSource).getConnection(); assertThatThrownBy(() -> createSqlHandler()) .isInstanceOf(JdbcConnectorException.class).hasMessage( "Could not connect to datasource \"dataSourceName\" because: java.sql.SQLException: test exception"); }