> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JDBC source

> Configuration reference for `JdbcSourceDescription` properties such as `url`, `username`, `password`, and `driver-class`, defined under the `dlc.jdbc.sources` namespace.

<Note>
  DLC provides a default JdbcSourceDescription with the name `defaultJdbcSourceDesc`.
</Note>

### Configuration properties

Properties for a JDBC Source are defined by name in the `dlc.jdbc.sources` namespace,
and are picked up as configurations for the DLC.

| Key | Required | Type | Description |
| - | :-: | - | - |
| url | Y | `String` | URL for JDBC connection |
| username | Y | `String` | Username for JDBC connection |
| password | Y | `String` | Password for JDBC connection |
| driver-class | Y | `String` | Driver class name for JDBC connection |
| topics-to-include | | `Set<String>` | Topics to include. See [source to topic matching](../../functional/source-to-topic-matching). |
| topics-to-exclude | | `Set<String>` | Topics to exclude. See [source to topic matching](../../functional/source-to-topic-matching). |
| accepts-topic-overrides | | `Boolean` | Whether this source is allowed to accept Topic Overrides in the [Load Request](../../operations/operations-load). |

#### YAML example

```yaml theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
dlc:
  jdbc:
    sources:
      jdbcSource:
        url: jdbc:mysql://localhost:3306/mydb
        username: username
        password: password
        driver-class: org.postgresql.Driver
        topics-to-include:
          - topic1
          - topic2
```

### Java configuration

`JdbcSourceDescription` Spring Beans are picked up as configurations for the DLC.

| Parameter | Required | Type | Description |
| - | :-: | - | - |
| name | Y | `String` | Name of the source. |
| url | Y | `String` | URL for JDBC connection |
| username | Y | `String` | Username for JDBC connection |
| password | Y | `String` | Password for JDBC connection |
| driverClass | Y | `String` | Driver class name for JDBC connection |
| topicsToInclude | | `Set<String>` | Topics to include. See [source to topic matching](../../functional/source-to-topic-matching). |
| topicsToExclude | | `Set<String>` | Topics to exclude. See [source to topic matching](../../functional/source-to-topic-matching). |
| acceptsTopicOverrides | | `Boolean` | Whether this source is allowed to accept Topic Overrides in the [Load Request](../../operations/operations-load). |

#### Java example

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
@Bean
JdbcSourceDescription source() {
    return JdbcSourceDescription.builder(
                    "jdbcSource",
                    "jdbc:mysql://localhost:3306/mydb",
                    "username",
                    "password",
                    "org.postgresql.Driver")
            .topicsToInclude(Set.of("topic1", "topic2"))
            .build();
}
```
