Updated on 2022-09-01 GMT+08:00

DataSourceConfig

Path

com.roma.apic.livedata.config.v1.DataSourceConfig

Description

This class is used with DataSourceClient to configure data sources.

Constructor Details

public DataSourceConfig()

Constructs a DataSourceConfig without parameters.

public DataSourceConfig(String type, String url, String user, String password)

Enter the data source type, connection string, username, and password to construct a DataSourceConfig.

Method List

Returned Type

Method and Description

String

getType()

Obtain the data source type.

String

getUrl()

Obtain the connection string.

String

getUser()

Obtain the username.

String

getPassword()

Obtain the password.

void

setType()

Set the data source type. The value can be mysql, mssql, oracle, postgresql, hive, redis, or mongodb.

void

setUrl()

Set the data source connection string.

void

setUser()

Set the data source username.

void

setPassword()

Set the data source password.

Method Details

  • public String getType()

    Obtain the data source type.

    Returns

    Data source type.

  • public String getUrl()

    Obtain the connection string.

    Returns

    Connection string.

  • public String getUser()

    Obtain the username.

    Returns

    Username.

  • public String getPassword()

    Obtain the password.

    Returns

    Password.

  • public void setType(String type)

    Set the data source type. The value can be mysql, mssql, oracle, postgresql, hive, redis, or mongodb.

    Input Parameter

    • type: specifies the data source type.
  • public void setUrl(String url)

    Set the data source connection string.

    If type is mysql, mssql, oracle, postgresql, or hive, set this parameter to the jdbc connection string. For example, "jdbc:mysql://127.0.0.1:8888/db?useUnicode=true&characterEncoding=utf8".

    If type is redis, the format is "127.0.0.1:6379@0", in which @0 indicates the Redis database ID and can be omitted.

    If type is mongodb, the format is "127.0.0.1:27017@db", in which db indicates the database name.

    Input Parameter

    • url indicates the connection string.
  • public void setUser(String user)

    Set the data source username. If type is redis, you do not need to set this parameter.

    Input Parameter

    • user indicates the username.
  • public void setPassword(String password)

    Set the data source password.

    Input Parameter

    • password indicates the password.