Can we connect to Couchbase DB thorugh Mobilefirst 8 Java OR Javascript SQL adapter? Please suggest alternative option if available.
Asked
Active
Viewed 133 times
1
-
The question is overly broad, please provide additional detail - what are you trying to do, and what have you already tried? A Javascript SQL adapter won't help you here, given that Couchbase is not a SQL database (and as far as I know, there is no JDBC driver for it). – patbarron May 03 '17 at 18:51
-
You can use a Java adapter and use it to make REST calls to the Couchbase DB. – Vivin K May 03 '17 at 20:01
-
There are JDBC drivers for Couchbase Server. You might also look at the Couchbase Mobile stack if you're interested in mobile data with sync. – Hod May 04 '17 at 18:32
2 Answers
3
You can use a MFP 8.0 Java adapter or Javascript HTTP adapter and use it to make REST calls to the Couchbase DB.

Vivin K
- 2,681
- 1
- 11
- 14
1
Yes it is possible to connect any NoSQL DB(Couchbase DB) using MFP 8.0 JavaScript or Java HTTP Adapters,making use of REST calls.
Here is an sample example which connects to IBM Cloudant NoSQL DB using MFP 8.0 JavaScript HTTP Adapter.
AdapterSample.js file -->
function getDocByKey(key) {
var path = '/my_database/'+key;
var input = {
method : 'get',
returnedContentType :'json',
path : path
};
return WL.Server.invokeHttp(input);
}
adapter.xml file -->
<mfp:adapter name="AdapterSample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mfp="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>AdapterSample</displayName>
<description>AdapterSample</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain> <-- DB URL here--> </domain>
<port>443</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<authentication>
<basic/>
<serverIdentity>
<username> <--DB Username here--> </username>
<password> <--DB Password here--> </password>
</serverIdentity>
</authentication>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="getDocByKey" secured="false"/>
</mfp:adapter>
Click here for more information https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/

manjunath kallannavar
- 597
- 5
- 16