# Understanding JDBC

Source: https://userguide.qualytics.io/source-datastore/datastore/deep-dive/jdbc/

## What is JDBC?

**JDBC (Java Database Connectivity)** is a standard Java API that provides a universal interface for connecting to relational databases. It acts as a bridge between applications and databases, allowing programs to execute SQL queries, retrieve results, and manage data - regardless of which database vendor is being used.

## How JDBC Works in Qualytics

Qualytics uses JDBC connectors to connect to relational databases. When you add a JDBC datastore, Qualytics:

1. **Establishes a connection** to your database using the credentials and connection properties you provide (host, port, username, password, database, schema).
2. **Discovers your schema** by reading the database catalog - tables, views, columns, and data types are automatically detected during the Sync operation.
3. **Reads data** using optimized JDBC queries, enabling parallel reads across partitions for large datasets.
4. **Writes enrichment output** to the linked destination, which can use a different connector. The source itself only needs read access; the destination needs the write permissions documented for its connector.

> **Info: Connections and Security**
>
> For details on connection configuration, authentication methods (Basic, Keypair, Service Principal, OAuth), and secrets management, see the [Connection](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/) documentation.

### Data Organization

In JDBC datastores, data is organized as:

- **Containers** - Tables and views in the database. Each container represents a structured dataset that Qualytics can profile, scan, and monitor.
- **Fields** - Columns within each table/view. Qualytics detects field names, data types, and constraints automatically.
- **Records** - Rows of data within each container, analyzed during Profile and Scan operations.

> **Info: Containers**
>
> For a detailed understanding of how Qualytics manages containers in JDBC datastores, see the [Containers Overview](https://userguide.qualytics.io/container/overview/) documentation.

### Field Type Detection

When a table is profiled, Qualytics uses **weighted histogram analysis** to detect field types automatically. This identifies data types such as integers, decimals, dates, timestamps, and text fields based on actual data distribution - not just the declared database column type. Detection runs only when the table setting **Infer the data type for each field and cast it appropriately** is on, and it applies to text columns. The setting is off by default for tables, so Profile keeps each column's declared database type until you turn it on and profile again. Sync only records the declared types. When a detected type differs from the declared one (for example, a text column that holds dates), the field overview shows it as **Detected Type**. Otherwise it shows the column's **Declared Type**. Field types cannot be changed on a single field.

### Multi-Schema Support

JDBC datastores support **multi-schema creation**, allowing you to discover and select multiple schemas from a single connection and create a separate source datastore for each selected schema in one step. This eliminates the need to add each schema individually.

> **Info: Multiple-Schema**
>
> For detailed instructions on multi-schema creation, refer to the [Multiple-Schema](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/multiple-schema/) documentation.

## Getting Started

- **Add with New Connection**

  Create a new JDBC datastore by setting up a new connection from scratch.

  [New Connection](https://userguide.qualytics.io/source-datastore/datastore/how-tos/add-new-source-datastore/)
- **Add with Existing Connection**

  Create a new JDBC datastore by reusing credentials from an existing connection.

  [Existing Connection](https://userguide.qualytics.io/source-datastore/datastore/how-tos/existing-connection/)
- **Available JDBC Connectors**

  Browse the full list of supported JDBC connectors and multi-schema support.

  [View Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-connectors/)
- **Connections**

  Configure connection details, authentication, and secrets management.

  [Connections](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/)

## Available Operations

Once a JDBC datastore is added, you can run the following operations to manage and ensure data quality:

| Operation | Description |
| --- | --- |
| [Sync](https://userguide.qualytics.io/operations/sync/sync/) | Discovers tables, views, and fields from your database. Detects new, changed, or removed containers incrementally. This is always the first operation after adding a datastore. |
| [Profile](https://userguide.qualytics.io/operations/profile/profile/) | Analyzes records across containers to compute statistics, detect data patterns, and have Qualytics AI generate quality checks (governed by the **AI Effort** setting). |
| [Scan](https://userguide.qualytics.io/operations/scan/getting-started/) | Executes quality checks against the data, measures data quality metrics, and detects anomalies at the record and schema levels. |
| [External Scan](https://userguide.qualytics.io/operations/external-scan/external-scan/) | Runs scan operations using externally provided data files instead of reading directly from the database. |

> **Tip**
>
> The recommended sequence is **Sync → Profile → Scan**. This cycle is repeatable - as your data evolves, re-running these operations keeps your quality checks and anomaly detection up to date.

---

## See Also

- **DFS Connectors**

  How Qualytics reads files from cloud object storage and distributed file systems.

  [DFS Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/dfs/)
- **Native Connectors**

  How Qualytics reads a platform's own storage or API without its query engine.

  [Native Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/native/)
- **Supported File Formats**

  The file formats DFS datastores read, including compressed variants.

  [Supported File Formats](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-file-formats/)
- **Filename Globbing**

  How DFS datastores group files with similar names into one container.

  [Filename Globbing](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/filename-globbing/)
- **HashiCorp Vault**

  Pull connection credentials from a secrets manager instead of typing them in.

  [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/)
- **Examples**

  Real scenarios, from onboarding a warehouse to protecting a busy database.

  [Examples](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/examples/)
- **Best Practices**

  Recommendations for scoping datastores, sharing connections, and keeping access tight.

  [Best Practices](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/best-practices/)
- **Permissions**

  The role and team permission each datastore action needs.

  [Permissions](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/permissions/)
- **How It Works**

  How a datastore maps to your storage, the layers behind it, the lifecycle, and the Timeline.

  [How It Works](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/how-it-works/)
- **Connection**

  How a connection holds the credentials that one or more datastores share.

  [Connection](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/)
- **Multiple-Schema**

  Create one datastore per schema or folder from a single connection.

  [Multiple-Schema](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/multiple-schema/)
- **Supported Connectors**

  Every connector by family, with its enrichment support and multi-schema fields.

  [Supported Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-connectors/)

*Last updated: November 16, 2026.*
