Query Project

The query() methods of Project Object enable you to run queries on models, tables, and views stored in a project.

Syntax

Use the query() method to submit a query to a project:

package org.example;

import mindsdb.MindsDB;
import mindsdb.models.Project;
import mindsdb.services.Query;
import mindsdb.services.Server;
import tech.tablesaw.api.Table;

public class Main {
    public static void main(String[] args) {
        Server server = MindsDB.connect();
        Project mindsdb = server.getProject("mindsdb");
        Query query = mindsdb.query("SELECT * FROM my_view");
        Table response = query.fetch();
        System.out.println(response);
    }
}
Updated on