Ibm mobilefirst IBM Mobilefirst用于连接Couchbase的Java适配器

Ibm mobilefirst IBM Mobilefirst用于连接Couchbase的Java适配器,ibm-mobilefirst,couchbase,mobilefirst-adapters,Ibm Mobilefirst,Couchbase,Mobilefirst Adapters,我们可以连接到Couchbase DB thorugh Mobilefirst 8 Java或Javascript SQL适配器吗?如果可用,请建议其他选项。您可以使用MFP 8.0 Java适配器或Javascript HTTP适配器对Couchbase DB进行REST调用。您可以使用MFP 8.0 Java适配器或Javascript HTTP适配器对Couchbase DB进行REST调用。可以连接任何NoSQL DB(Couchbase DB)使用MFP8.0JavaScript或Ja

我们可以连接到Couchbase DB thorugh Mobilefirst 8 Java或Javascript SQL适配器吗?如果可用,请建议其他选项。

您可以使用MFP 8.0 Java适配器或Javascript HTTP适配器对Couchbase DB进行REST调用。

您可以使用MFP 8.0 Java适配器或Javascript HTTP适配器对Couchbase DB进行REST调用。

可以连接任何NoSQL DB(Couchbase DB)使用MFP8.0JavaScript或JavaHTTP适配器,利用REST调用

下面是一个使用MFP8.0JavaScript HTTP适配器连接到IBMCloudAntNoSQL数据库的示例

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>
AdapterSample.js文件-->
函数getDocByKey(键){
var path='/my_database/'+key;
变量输入={
方法:“get”,
returnedContentType:'json',
路径:路径
};
返回WL.Server.invokeHttp(输入);
}
adapter.xml文件-->
适配器样本
适配器样本
https
443
30000
30000

是的,可以使用MFP8.0JavaScript或JavaHTTP适配器,利用REST调用连接任何NoSQL数据库(Couchbase数据库)

下面是一个使用MFP8.0JavaScript HTTP适配器连接到IBMCloudAntNoSQL数据库的示例

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>
AdapterSample.js文件-->
函数getDocByKey(键){
var path='/my_database/'+key;
变量输入={
方法:“get”,
returnedContentType:'json',
路径:路径
};
返回WL.Server.invokeHttp(输入);
}
adapter.xml文件-->
适配器样本
适配器样本
https
443
30000
30000

问题过于宽泛,请提供更多详细信息-您正在尝试做什么,您已经尝试了什么?考虑到Couchbase不是SQL数据库(据我所知,它没有JDBC驱动程序),Javascript SQL适配器在这里对您没有帮助。您可以使用Java适配器并使用它对Couchbase DB进行REST调用。Couchbase Server有JDBC驱动程序。如果您对同步移动数据感兴趣,还可以查看Couchbase Mobile stack。问题过于广泛,请提供更多详细信息-您正在尝试做什么,以及您已经尝试了什么?考虑到Couchbase不是SQL数据库(据我所知,它没有JDBC驱动程序),Javascript SQL适配器在这里对您没有帮助。您可以使用Java适配器并使用它对Couchbase DB进行REST调用。Couchbase Server有JDBC驱动程序。如果您对同步移动数据感兴趣,还可以查看Couchbase Mobile stack。