Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Kantilalr
    Can we connect third party database like mysql, oracle in...
    Topic posted March 7, 2018 by Kantilalr , tagged Mobile 
    53 Views, 3 Comments
    Title:
    Can we connect third party database like mysql, oracle in MCS ?
    Summary:
    Can we connect third party database like mysql, oracle in MCS ?
    Content:

    Hi,

     

    Is there any way to conenct any third party database like mysql, oracle in MCS ?

     

    For eg. we can conenct JDBC connection in java same as I want to conenct any third party database in MCS.

    Comment

     

    • Arun Pareek

      Hi,

      Oracle MCS provides connectors for only SOAP and REST based interfaces instead of native JDBC based connectors.

      However MCS lets you implement API using NodeJS which can be exposed through a Mobile blackened.

      Through this approach you can connect to any backend third party database like MySQL by utilizing node modules such as

      https://github.com/mysqljs/mysql

      Hope that helps.

    • Jeff X Davies

      There is one caveat to Arun's info. MCS is usually running in an Oracle Managed environment. As a result, accessing ports other than 80 and 443 is restricted. To reach a MySQL server running on its native 3306 port, you would need to add port forwarding from port 80 to 3306. Alternatively, you could create a REST service layer that acts as an intermediary between port 80 and port 3306, essentially REST-enabling the database.

      I would bet it is possible to configure MySQL to listen to port 80, though I've never heard of it being done.

      - Jeff

    • Martin Jarvis

      With OMCe you absolutely can. You will need a pure javascript (i.e. no native code) library for the database you are trying to access. For MySQL you can use https://github.com/mysqljs/mysql.

      Just download and unzip your custom API scaffold from OMCe, then use npm to install and add the database library to your package.json dependencies.

      for example:

      {
        "name": "accounts",
        "version": "1.0.0",
        "description": "Accounts",
        "main": "accounts.js",
        "oracleMobile": {
          "dependencies": {
            "apis": {},
            "connectors": {}
          }
        },
        "dependencies": {
          "bluebird": "^3.5.1",
          "mysql": "^2.15.0"
        }
      }

       

      Then follow the instructions in your database library's documentation on how to make database queries from your own node.js api implementation code.

      Remember to include your node_modules directory in the zip file you deploy to OMCe. Our Custom Code Test Tools available from bit.ly/omcedownloads will help you test and deploy your custom code locally from the command line.

      Regards

      Martin

      Oracle Mobile & Bots Product Management