Font Size:

Database Query Tool

Introduction

The Database Query Tool allows your AI agent to run SQL queries on a selected datasource. Typically, the AI generates a SQL query string based on user input or prompt context, and this tool executes that query and returns the result.

You can use either the default Joget datasource or a custom database connection via JDBC.

Get started

How to use it

To use the Database Query Element, add the Database Query tools:

  1. Locate the Database Query element under the Tools section of the palette.
  2. Drag and drop the element into the Drop a tool to here section.

Configure Form Properties

To properly integrate and configure the Database Query, set the following fields:

  • Function Name: Unique name used to call this tool function from the AI agent.
  • Function Description: Short description of what the tool does (e.g., "Query customer orders").
  • Datasource: Select the database to run the query on.
    • Default Datasource : Use Joget's default datasource.
    • Custom Datasource: Use a different database. Provide connection info below.
      • Custom JDBC Driver: Fully qualified class name of the JDBC driver (e.g., com.mysql.cj.jdbc.Driver).
      • Custom JDBC URL: JDBC URL of the database (e.g., jdbc:mysql://host:3306/dbname).
      • Custom JDBC Username: Username for the database connection.
      • Custom JDBC Password: Password for the database connection.
Created by Gabriel Last modified by Gabriel on Jun 24, 2025