[]
        
(Showing Draft Content)

Develop a JDBC Custom Source

Developing a Custom Connector for JDBC Data Providers

For data providers that provide only JDBC drivers, you can develop custom connectors using an open source wrapper available on GitHub - chequer-io/JDBC.NET which allows you to use JDBC drivers in ADO.NET.


The steps to create a JDBC custom connector:

  • Create a Visual Studio Class Project and name it according to the custom provider you want to support.

  • Search Nuget for Gcef.CustomProvider.Native package and install it in the project.

  • Search Nuget for JDBC.NET by CHEQUER

  • Downlaod the jar file for the JDBC driver of the database you want to support and add it to the project

  • Add three resources to the project:

    • A small 16x16 icon for the custom provider to be displayed in Wyn.

    • A large 180x130 icon for the custom provider to be displayed in Wyn.

    • A markdown file named UserGuide.md: You can include information about the data provider and the connection string.

  • Select the three resource files and the jar file and set the "Copy to Output Directory" to "Copy Always".

  • Name the main class project class according to your provider and write code to implement the INativeQueryDataProvider interface.

  • Once done development and testing build the project and publish it.

  • Zip the published artifcats and send them to the Wyn administrator to deploy to Wyn. Refer to the steps in the Administrators guide.

In Wyn, this data provider is treated as a Native data provider but you can only be used in the following scenarios:

  • Native dataset designer

  • CustomSQLTable in direct/cache dataset designer

The sample, which you can download below, uses that JDBC wrapper and provides you with sample code to develop you own JDBC-only data provider. You need to include the JDBC driver to the data provider you need to connect to and include it when you deploy you custom data connector.

Sample JDBC to connect to SQL Server

In the zip file that you can download from the link below, you can find a JDBC demo custom connector code that can be deployed to Wyn.

NativeJdbcProvider.zip

Disclaimer

  • The source code of this data provider is provided as-is. You can modify it to fit your needs. You can also redistribute it without any restrictions.

  • This data provider is a demo provider published by the Wyn team for the purpose of demonstrating how to create a custom data provider. It is not guaranteed to work in all scenarios. If you have any questions, please email the Wyn experts.

JDBC drivers

JDBC drivers are NOT included in this data provider itself. You must specify the JDBC driver path to initiate the connection.

See connection string pattern section for more details.

Limitations

Data type mapping

This data provider uses gRpc and protobuf to communicate with the Java runtime. Data of some unconventional data types may not be supported.


If your database table contains columns of such data types, you may need to write your command text carefully to avoid these columns.

RowLimitOption

Sometime Wyn intends to retrieve the result schema of a given command. However, this provider does not know what the underlying database is, so it is impossible to attach a "TOPN" or "LIMIT" clause to the command text.


As a workaround, the provider will try to append a "LIMIT ?" clause to the command text if needed. This is not guaranteed to work. If the try fails, the provider will execute the raw command and take only the rows of specified limit.


This known limitation may impact the performance when:

  • Creating CustomSQLTable in direct/cache dataset designer

  • Entering dataset designer to edit existing direct/cache dataset using this provider

From this perspective, it is recommended to use this provider in the scenarios where the command will not return a large number of rows.

Data source preview

Like built-in native data providers, this provider does not support data source preview.

Platform support

This data provider works with Wyn service deployed on Windows(x64) and Linux(x64).