Skip to content

Commit

Permalink
[Improve][Connector-v2][Jdbc] check url not null throw friendly messa…
Browse files Browse the repository at this point in the history
…ge (#5097)

* check url not null throw friendly message

* check jdbc source config

* modify jdbc validate method

---------

Co-authored-by: 80597928 <[email protected]>
Co-authored-by: 80597928 <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2023
1 parent a3c13e5 commit b0815f2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.seatunnel.api.common.PrepareFailException;
import org.apache.seatunnel.api.configuration.ReadonlyConfig;
import org.apache.seatunnel.api.configuration.util.ConfigValidator;
import org.apache.seatunnel.api.serialization.Serializer;
import org.apache.seatunnel.api.source.Boundedness;
import org.apache.seatunnel.api.source.SeaTunnelSource;
Expand Down Expand Up @@ -94,6 +95,7 @@ public String getPluginName() {
@Override
public void prepare(Config pluginConfig) throws PrepareFailException {
ReadonlyConfig config = ReadonlyConfig.fromConfig(pluginConfig);
ConfigValidator.of(config).validate(new JdbcSourceFactory().optionRule());
this.jdbcSourceConfig = JdbcSourceConfig.of(config);
this.jdbcConnectionProvider =
new SimpleJdbcConnectionProvider(jdbcSourceConfig.getJdbcConnectionConfig());
Expand Down

0 comments on commit b0815f2

Please sign in to comment.