Skip to content

Custom Datasource

Follow the steps to create a custom Datasource in AIV:

  1. Create a Java Project: Begin by setting up a new Java project in your preferred Integrated Development Environment (IDE).

  2. Include External JAR: Add the required external JAR file to the project’s /lib folder.

  3. Create the Custom Class: Create a class named Exds and implement the CustomData interface in it.

  4. Override Unimplemented Methods: The CustomData interface has three methods that need to be implemented:

    public interface CustomData {
        public List<Map<String, Object>> getData(Map<String, Object> detaisIN, String addInfoIN);
        public List<Map<String, Object>> getMetaData(Map<String, Object> detaisIN, String addInfoIN);
        public String testConnection(Map<String, Object> detaisIN, String addInfoIN);
    }
    • getData: Implement logic to fetch data from external sources such as databases or files.
    • getMetaData: Implement logic to retrieve metadata related to tables, columns, data types, etc.
    • testConnection: Implement logic to verify if the connection to the database is successful, if applicable.
  5. Create a Custom Datasource in AIV: Navigate to the datasource section in the AIV application. Create a new custom datasource and provide the full class name of the implementation, e.g., com.externalds.Exds.

  6. Test the Connection: Test the connection to ensure that it is successfully established and then save the datasource.

  7. Create a Dataset: Use the newly created datasource to create a dataset. Click on metadata and preview to verify that it is functioning correctly.