MS SQL Module
Introduction
Being a concrete module of the JDBC meta module, the MS SQL can be used to access relational SQL databases via the middleware.
This documentation will focus on the usage of this specific module. Please refer to the JDBC Module documentation for common matters.
Crawling a Database
In order to crawl a database, we need to add the MS SQL module to our backend. This can be done using the Module Market in the Dashboard and should automatically add the JDBC meta module.
The crawl can be started in the Dashboard or via HTTP request:
-
For crawling via Dashboard, you can hover over the added MS SQL module and click Use. Then fill out the necessary parameters and click the button to start crawling.
-
For crawling via HTTP request, you send a request similar to this and fill out the necessary parameters as query parameters:
curl -X GET "http://[YOURHOST]/yambas/rest/modules/MSSQL/MyTestApp/spec/crawler/?dbHost=mydb.example.com&dbPort=1433&..." -u [CUSTOMEREMAIL]:[CUSTOMERPWD]
The following table lists the parameters that can or need to be set in the Dashboard or as query parameters in the HTTP request.
HTTP request |
Dashboard field name |
Extended description |
Example |
dbHost |
DB IP address or hostname |
|
|
dbPort |
DB port |
|
|
dbName |
DB name |
|
|
schemaName |
DB schema name |
|
|
userName |
DB user name
|
Not the ApiOmat customer or user name, but the database username |
|
password |
DB user password |
Not the ApiOmat customer or user password, but the database user password |
|
customerName |
ApiOmat Customer name |
The name that you use to log in to the dashboard |
|
reCrawl |
TRUE to overwrite previous crawling |
|
|
noPkIdColumns |
ID columns of tables without PK (optional) |
The PK of a table gets used as ID in ApiOmat classes. |
|
appName |
App name |
The name of your backend where you want to add the crawled module to |
|
This might take up to a few minutes depending on the size of our database. As soon as it is finished, a notification will be displayed. The crawled module should already be added to the backend you set as "appName" parameter. You might need to refresh the Dashboard page or use the "Refresh module" button to see the module in your backend's module list.
With the above examples, the name of the crawled module is MSSQLProductsMyTestApp, which is put together by combining "MSSQL" + DB name + app name.
From this point onward, the next steps are identical with any other JDBC module. You can continue by checking the crawled module as described in de JDBC meta module documentation.