Skip to content



Data can be sent from/to AMI using a JDBC connection. This connection is controlled by the configuration file (see the Configuration Guide for more details).

The port for connecting to AMI via the AMI JDBC driver. Default is 3280

Optional. Specifies the network interface that the ami.db.jdbc.port server port will be bound to

# provide either a list of permitted hostname patterns or plugin for blocking/granting access based on foreign network address. Syntax is either file:<file_containing_a_hostname_patterns_per_line> or text:<comma_delimited_list_of_hostname_patterns> or plugin:<class_name_implementing_com.f1.ami.amicommon.AmiServerSocketEntitlementsPlugin>

# By default pointing to ${ami.db.auth.plugin.class}, which sets target database's JDBC endpoints

Example: Java

import java.sql.*;
public class AmiJdbcSample {
//IMPORTANT NOTE: be sure to include out.jar in your java classpath. The out.jar file is located in the lib folder of your ami installation
    public static final String NEW_LINE = System.getProperty("line.separator");
    public static void main(String a[]) throws SQLException, ClassNotFoundException {
        final String url = "jdbc:amisql:localhost:3280?username=demo&password=demo123";
        final Connection conn = DriverManager.getConnection(url);
        try {
            final ResultSet rs = conn.createStatement().executeQuery("select * from __TABLE");
        } finally {
    public static String resultSetToString(ResultSet rs) throws SQLException {
        final StringBuilder r = new StringBuilder();
        final ResultSetMetaData metaData = rs.getMetaData();
        final int columnCount = metaData.getColumnCount();
        for (int i = 1; i <= columnCount; i++)
            r.append(metaData.getColumnName(i)).append(i == columnCount ? NEW_LINE : "\t");
        while (
            for (int i = 1; i <= columnCount; i++)
                r.append(rs.getObject(i)).append(i == columnCount ? NEW_LINE : "\t");
        return r.toString();

Example: Python

Prerequisites: A jre (Java runtime environment, for JDBC) needs to be installed.

  1. Install the JayDeBeApi module.

    JayDeBeApi is an adapter of JDBC for python. You can install it using pip:

    pip install JayDeBeApi

    Alternative ways to install JayDeBeApi:

  2. Start AMI One

  3. Connect to amisql from python:

    1. You'll need the path to the out.jar file. This can be found in the ami/amione/lib folder.

    2. Find the server hostname and ami.db.jdbc.port (default is 3280).

    3. Copy this script, replacing the <placeholders> with appropriate values:

    import jaydebeapi
    conn = jaydebeapi.connect("com.f1.ami.amidb.jdbc.AmiDbJdbcDriver",
        {"user": "<username>", "password": "<password>"},
  4. To run queries, create a cursor:

    curs = conn.cursor()
  5. Queries can then be executed using the execute method:

    curs.execute("show tables")
  6. Results are fetched using the fetchall method, which returns a list:

  7. Close the cursor once finished:


You can also execute queries within a with block for the cursor so you don't have to worry about closing it:

with conn.cursor() as curs:
    curs.execute("show tables")
    result = curs.fetchall()

Example: DBeaver

  1. Add driver configuration in DBeaver

    1. Go to Database -> Driver Manager, Open driver manager dialogue and click New

    1. Configure the AMIDbJdbcDriver

    Parameter Description Example
    Driver Name Name of your driver. It can be any name you like AmiDbJdbcDriver
    Driver Type Driver Provider Generic
    Class Name JDBC driver class name com.f1.ami.amidb.jdbc.AmiDbJdbcDriver
    URL Template Template of driver URL, should follow the format like: jdbc:amisql:<host>:<jdbc port><login details> jdbc:amisql:localhost:3280?username=demo&password=demo123
    Default Port Default AMI JDBC port is 3280 3280
    Default Database Default database is AMI AMI
    Default User Default user name is demo demo
    Description Description of the driver driver for connection to AMIDB
    1. Go to Libraries tab and add the out.jar file(/amione/lib/out.jar) into it and hit ok

  2. Establish Database Connection With the AMIDbJdbc Driver

    1. Go to Database -> New Database Connection and select the AMIDbJdbc driver we just configured

    1. Enter the URL and your login information. Your AMI Database is ready to go.