You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/03/11 05:57:18 UTC

[camel-kafka-connector-examples] 01/01: SQL Source Connector: Add instruction on how to point to a different Database Name

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch ckc-ex-sql-source
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector-examples.git

commit 17b656c6cc79e819c13d7ed1b360dbbc1ea99172
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 11 06:57:13 2022 +0100

    SQL Source Connector: Add instruction on how to point to a different Database Name
    
    Fixes #330
---
 sql/sql-source/README.adoc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/sql/sql-source/README.adoc b/sql/sql-source/README.adoc
index b5ef272..436cb7e 100644
--- a/sql/sql-source/README.adoc
+++ b/sql/sql-source/README.adoc
@@ -128,6 +128,28 @@ camel.source.path.query=select * from accounts
 
 and add the correct IP for the container.
 
+NOTE: In case you'd like to use a different database name instead of the default one, you could add the following configuration parameter to your configuration file:
+
+[source]
+----
+name=CamelSqlSourceConnector
+connector.class=org.apache.camel.kafkaconnector.sql.CamelSqlSourceConnector
+key.converter=org.apache.kafka.connect.storage.StringConverter
+value.converter=org.apache.kafka.connect.storage.StringConverter
+
+topics=mytopic
+
+camel.component.sql.dataSource.user=postgres
+camel.component.sql.dataSource.password=mysecretpassword
+camel.component.sql.dataSource.serverName=172.17.0.2
+camel.component.sql.dataSource.databaseName=dbname
+camel.component.sql.dataSource=#class:org.postgresql.ds.PGSimpleDataSource
+
+camel.source.path.query=select * from accounts
+----
+
+In this way you'll be able to point to a different database name.
+
 === Running the example
 
 Run the kafka connect with the SQL Source connector: