Files
stream-applications/applications/source/jdbc-source
2022-02-24 20:38:47 -05:00
..
2022-02-24 20:38:47 -05:00
2022-01-21 17:52:10 -05:00

//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.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[]