1. Home
  2. Docs
  3. ODBC2JSON
  4. Using ODBC 2 JSON GW
  5. Configuration

Configuration

After installing you need to configure ODBC2JSON GW.

Open the configuration file C:\Program Files (x86)\BecTec Solutions\BecTec ODBC2JSON\BecTecODBC2JSON.exe.config in an texteditor.

   <appSettings>
    <add key="_API_URL" value="http://localhost:9001" />
	<add key="apikey" value="adqevqevqeefq123123QFDFFa" />
	<add key="DefaultDatabaseTableDateColumn" value="salaries.from_date" />   
    	<add key="DefaultDatabaseTable" value="salaries" />
	<add key="Custom_SQL_Query_1" value="select * from salaries" />
	<add key="Custom_SQL_Query_2" value="" />
    	<add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
	
<!-- ALWAYS USE DATABASE USER WITH READONLY ACCESS -->
	
  <connectionStrings>
    	<add name="DefaultConnectionString" connectionString="DSN=MariaDB;Database=employees" />
    	<add name="db2" connectionString="DSN=MariaDB;Database=pb" />
	<add name="SQL" connectionString="DSN=MSQL;Database=SampleDB" />
  </connectionStrings>

_API_URL:

The address and TCP port ODBC2JSON is using.

Default value: http://localhost:9001

If you need to access ODBC2JSON from an remote client you can change the value to http://*.9001 (remember to also check you firewall settings) ODBC2JSON IS NOT DESIGNED FOR PUBLIC ACCESS FROM THE INTERNET.

apikey:

You need the apikey to access data, you can change it to anything you like.

DefaultDataBaseTable:

Used when the database table name is not included in the API request

DefaultDatabaseTableDateColumn

Used when you need to select data between two dates, also needed when using Power BI incremental refresh.

Custom_SQL_Query_*:

You can use multiple custom sql queries, the default SQL query is “SELECT * from tablename”.

connectionStrings

Change the DefaultConnectionString to access your 32-Bit ODBC datasource.

For connection string examples go to https://www.connectionstrings.com

Testing your settings

Save your settings and start the ODBC2JSON console app

Then you can open the url http://localhost:9001/api/odbc2json/GetTable?tablename=yourdatabasetable&apikey=yourapikey in your browser to check that everthing is working as expected.

How can we help?