//tag::ref-doc[]
= JDBC Source

This source polls data from an RDBMS.
This source is fully based on the `DataSourceAutoConfiguration`, so refer to the https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html[Spring Boot JDBC Support] for more information.

=== Payload

* `Map<String, Object>` when `jdbc.split == true` (default) and `List<Map<String, Object>>` otherwise

== Options

The **$$jdbc$$** $$source$$ has the following options:

//tag::configuration-properties[]
Properties grouped by prefix:


=== jdbc.supplier

$$max-rows$$:: $$Max numbers of rows to process for query.$$ *($$Integer$$, default: `$$0$$`)*
$$query$$:: $$The query to use to select data.$$ *($$String$$, default: `$$<none>$$`)*
$$split$$:: $$Whether to split the SQL result as individual messages.$$ *($$Boolean$$, default: `$$true$$`)*
$$update$$:: $$An SQL update statement to execute for marking polled messages as 'seen'.$$ *($$String$$, default: `$$<none>$$`)*

=== spring.cloud.stream.poller

$$cron$$:: $$Cron expression value for the Cron Trigger.$$ *($$String$$, default: `$$<none>$$`)*
$$fixed-delay$$:: $$Fixed delay for default poller.$$ *($$Long$$, default: `$$1000$$`)*
$$initial-delay$$:: $$Initial delay for periodic triggers.$$ *($$Integer$$, default: `$$0$$`)*
$$max-messages-per-poll$$:: $$Maximum messages per poll for the default poller.$$ *($$Long$$, default: `$$1$$`)*
$$time-unit$$:: $$The TimeUnit to apply to delay values.$$ *($$TimeUnit$$, default: `$$<none>$$`, possible values: `NANOSECONDS`,`MICROSECONDS`,`MILLISECONDS`,`SECONDS`,`MINUTES`,`HOURS`,`DAYS`)*

=== spring.datasource

$$data$$:: $$Data (DML) script resource references.$$ *($$List<String>$$, default: `$$<none>$$`)*
$$driver-class-name$$:: $$Fully qualified name of the JDBC driver. Auto-detected based on the URL by default.$$ *($$String$$, default: `$$<none>$$`)*
$$initialization-mode$$:: $$Mode to apply when determining if DataSource initialization should be performed using the available DDL and DML scripts.$$ *($$DataSourceInitializationMode$$, default: `$$embedded$$`, possible values: `ALWAYS`,`EMBEDDED`,`NEVER`)*
$$password$$:: $$Login password of the database.$$ *($$String$$, default: `$$<none>$$`)*
$$schema$$:: $$Schema (DDL) script resource references.$$ *($$List<String>$$, default: `$$<none>$$`)*
$$url$$:: $$JDBC URL of the database.$$ *($$String$$, default: `$$<none>$$`)*
$$username$$:: $$Login username of the database.$$ *($$String$$, default: `$$<none>$$`)*
//end::configuration-properties[]

Also see the https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html[Spring Boot Documentation]
for addition `DataSource` properties and `TriggerProperties` and `MaxMessagesProperties` for polling options.

//end::ref-doc[]
