Skip to main content

Database

Read new orders from, or write results to, a table - PostgreSQL, SQL Server, Oracle or MySQL.

Data & cloud↓ Inbound↑ Outbound
Type codeDATABASE
Camel componentcamel-sql
Formats carried
JSON
Terms used on this page

JDBC - Java Database Connectivity - the address format used to reach a database

See the Glossary for every term.

Only PostgreSQL is signed in to by the test

For PostgreSQL, Test connection signs in and runs SELECT 1. For SQL Server, Oracle and MySQL it only checks that the host and port answer, because their drivers are not installed yet (see Stage 2).

The query

Inbound: the SELECT that returns new rows. Outbound: the INSERT, with :#field placeholders. The worked example uses a read-only user.

Worked example​

LIS order table (SQL Server) · Inbound · JSON · Test passes on any engine: No - placeholder values

Placeholder database on example.com - replace with the partner's JDBC URL, a read-only user and password.

Values entered by Fill example
{
"direction": "Inbound",
"format": "JSON",
"settings": {
"jdbcUrl": "jdbc:sqlserver://lis-db.example.com:1433;databaseName=orders",
"username": "reader",
"query": "SELECT * FROM new_orders WHERE sent = 0",
"pollSeconds": "60"
}
}
Placeholder values

The addresses above are placeholders on example.com. Replace them with your partner's real details before running Test connection.

This is what the console's Fill example button enters. Secrets are never part of an example. Every setting is explained below.

Settings​

Required fields are marked Yes. Fields marked 🔒 (password) are stored encrypted and never sent back to the browser - the console only shows Set / Not set. A field marked inbound only or outbound only appears just for that direction.

SettingTypeRequiredDefaultWhat to enter
jdbcUrl
JDBC URL
textYesjdbc:postgresql://e.g. jdbc:postgresql://host:5432/lis or jdbc:sqlserver://host:1433;databaseName=lis
username
Username
textYes—Required: a database account that can read (in) or write (out) the table, e.g. lis_reader.
password
Password
passwordNo—🔒 secret. That account's password. Stored encrypted.
query
Query
textareaNo—Inbound: the SELECT that returns new rows. Outbound: the INSERT, with :#field placeholders.
pollSeconds
Poll every (seconds)
numberNo60inbound only. How often to run the query, e.g. 60 (seconds).

What "Test connection" checks​

PostgreSQL: signs in and runs SELECT 1. Others: the host and port answer (their drivers come in Stage 2).

Test connection is read-only and says how far it got: verified, reached, checked or failed. See Testing a connection, and Troubleshooting if it fails.