Skip to main content

Custom Datasource

Follow the steps to create custom Datasource in AIV:

  1. First you have to create JAVA project.

  2. Include external.jar in project "/lib" folder.

  3. Now create on class "exds" and implements "CustomData" interface in it.

  4. Override unimplemented methods, here you will find three methods as "CustomData" imterface have 3 methods.

     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);
    }
    1. getData: In this methods we have to write logic related to fetching data from any external DB, files etc.
    1. getMetaData : In this method we have to write logic related to fetching metadata related to table, columns, datatype etc.
    1. testConnection: In this method we have to check if connection with DB is successfull if we are using any.

Please find the below sample project to see how to implement this all methods. Project Link.

  1. Create a custom datasource in AIV application from datasource section and in class name pass the full class name which implements "CustomData" interface. E.g. "com.externalds.exds"
  2. Test connection and save the datasource.
  3. Create Dataset using that datasource and click on metadata and preview to check if it is working properly or not.