Custom Datasource
Follow the steps to create a custom Datasource in AIV:
-
Create a Java Project: Begin by setting up a new Java project in your preferred Integrated Development Environment (IDE).
-
Include External JAR: Add the required external JAR file to the project’s
/lib
folder. -
Create the Custom Class: Create a class named
Exds
and implement theCustomData
interface in it. -
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.
-
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
. -
Test the Connection: Test the connection to ensure that it is successfully established and then save the datasource.
-
Create a Dataset: Use the newly created datasource to create a dataset. Click on metadata and preview to verify that it is functioning correctly.