// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-jdbc"]
= JDBC
:page-aliases: extensions/jdbc.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-jdbc
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Access databases through SQL and JDBC.
:cq-deprecated: false
:cq-jvm-since: 0.0.1
:cq-native-since: 0.0.1

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##0.0.1## [.badge-key]##Native since##[.badge-supported]##0.0.1##
endif::[]

Access databases through SQL and JDBC.

[id="extensions-jdbc-whats-inside"]
== What's inside

* xref:{cq-camel-components}::jdbc-component.adoc[JDBC component], URI syntax: `jdbc:dataSourceName`

Please refer to the above link for usage and configuration details.

[id="extensions-jdbc-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-jdbc[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jdbc</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-jdbc-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

[id="extensions-jdbc-configuration-configuring-a-datasource"]
=== Configuring a DataSource

This extension leverages https://quarkus.io/guides/datasource[Quarkus Agroal] for `DataSource` support. Setting up a `DataSource` can be achieved via configuration properties.
It is recommended that you explicitly name the datasource so that it can be referenced in the JDBC endpoint URI. E.g. like `to("jdbc:camel")`.

[source,properties]
----
quarkus.datasource.camel.db-kind=postgresql
quarkus.datasource.camel.username=your-username
quarkus.datasource.camel.password=your-password
quarkus.datasource.camel.jdbc.url=jdbc:postgresql://localhost:5432/your-database
quarkus.datasource.camel.jdbc.max-size=16
----

If you choose to not name the datasource, you can resolve the default `DataSource` by defining your endpoint like `to("jdbc:default")`.

[id="extensions-jdbc-configuration-zero-configuration-with-quarkus-dev-services"]
==== Zero configuration with Quarkus Dev Services

In dev and test mode you can take advantage of https://quarkus.io/guides/datasource#dev-services-configuration-free-databases[Configuration Free Databases]. All you need to do is reference the default database in your routes. E.g `to("jdbc:default")`.

