How Can i Connect Flutter (Dart) with my Oracle Server ? Have Some one Tried on this?

7,489

Solution 1

I have a similar use case scenario, I'm creating a new mobile app in Flutter for an already existing web app that use an Oracle DB.

As the above replies I've create the REST APIs using this Oracle Database driver for Node.js node-oracledb https://github.com/oracle/node-oracledb. So far I can say that it is stable and well documented. You can also add this one https://www.npmjs.com/package/simple-oracledb in order to extend capabilities of oracledb (I've use this one to run multiple oracle operations in a single transaction).

After that on Flutter you can create your models using json_serializable https://pub.dartlang.org/packages/json_serializable to generate to/from JSON code for a class. You can parse the response that came from the API in order to convert the JSON response to object (or even better a dataset output send in json response to a list of objects) .

https://medium.com/flutter-io/some-options-for-deserializing-json-with-flutter-7481325a4450

Solution 2

As @Raouf Rahiche commented above my suggested solution would also be to go for REST APIs solution that is make your Database schema on oracle and do some server side code to connect with the database and send or retrieve data in the form of JSON Its being used as most widely solution now a days for server-client communication.

But if you still want your app to communicate directly with oracle, i found a useful library on Dart package site. Oracle 0.1.0

Hope this will help you

Solution 3

Creating RESTful web service is the solution. Oracle has provided ORDS(Oracle Restful Data Service) to create web service using PL-SQL. No need to do server side coding in any other language. ORDS can be configured with command line or GUI in Oracle's SQL Developer. Minimum Database version should be 12C R 2 as it gives good support to JSON table. I have implemented all four handles in ORDS[get,put,post and delete] and connected with flutter app.

Share:
7,489
Sardar Haseeb
Author by

Sardar Haseeb

Updated on December 06, 2022

Comments

  • Sardar Haseeb
    Sardar Haseeb over 1 year

    I need to Connect My Flutter App With my Oracle Server ..Searched Google but no good resource found except one on dart web but it is no more used with current dart version.Have Some one tried this please tell and explain what should i do ?

    Recently i have seen video on YouTube in which Alibaba team made a flutter app and seriously i do not think they use fire base for that .they have their own servers and will not provide data to some third party.There must be a way to connect flutter with Servers. Please Explain.

    • Raouf Rahiche
      Raouf Rahiche over 5 years
      create a RESTful web service an expose the data you want from your database and don't connect directly with a remote database
    • Sardar Haseeb
      Sardar Haseeb over 5 years
      Restful web service to get data in Json format ? and use materialized view not to connect server directly ?
    • Raouf Rahiche
      Raouf Rahiche over 5 years
      yes you get the data a JSON . and the connection part i mean that don't connect directly to the database from your app do it with the service
  • Christian
    Christian about 2 years
    Were you able to use that lib with Dart2 ?