Connecting to external database in iOS - ios

I know I can use SQLlite and of course a clientdataset, but....
How do I connect to an external database over the internet in iOS using Firemonkey?

There's a blog page on EDN here, it uses a non-visual datasnap library:
http://edn.embarcadero.com/article/41729
Link to the source code: http://cc.embarcadero.com/item/28579
The example connects to a remote Interbase, server, but it should be fairly easy to rewrite it to use other databases like MySQL.

Related

Connecing to MapR database from Delphi/C++Builder app

I'm trying to find out if there is something like FireDac or dbExpress to connect an application written in Delphi or C++ Builder to a MapR Database. I was able to find this page that describes how to connect to various databases including Teradata, but there is no mention of MapR.If anyone has done this, I would really appreciate any pointers you might be able to give me.
FireDAC does not natively support MapR nor does dbExpress.
Your options seem to be:
Use MapR's REST Api - see REST or just google
mapr rest api
Use ODBC access. There is one available here: HiveODBC.

How do I create a Dart Server database?

I know that it is possible to create a IndexedDb at client side, but I was wondering if it possible to create a key/value store server Side. In that case we could use that db as a cache server or even as an elasticSearch server, or maybe replace a SQL or NoSQL database
Unfortunately it is not possible to create an IndexedDb on the server in Dart. The implementation primarily leverages the APIs provided by the client-side navigator (eg. Chrome, Firefox, etc). IndexedDb is a developing web standard which will hopefully be implemented in all browsers in the future. In this way, Dart is basically using APIs to access a separate database (albeit a very simple one). It is not implemented in Dart itself.
That said, in addition to other serverside database APIs, there is also a Dart client interface for memcache which can be run on the sever to connect to a memcache instance
You can use any database on the server where a Dart driver is available (not so many yet, but in the future there will be support for most mainstream databases.
take a look at
https://pub.dartlang.org/packages/yomp_db
http://pub.dartlang.org/packages/mongo_dart
http://pub.dartlang.org/packages/sqljocky

Connecting to SQL database inside iPhone App

I wanted to know the procedure to connect to SQL Database from an iPhone app. The read and write procedure to the SQL database and syncing it with iPhone's local database which is in sqlite, so that any changes in SQL database/sqlite database should be reflected on both.
The above answers are lacking. If you want to connect directly to a SQL sever from an iOS device you can use freeTDS. There are several compiled version that run on iOS. It is not as difficult as drag and drop developers would lead you to believe.
Cross compiling FreeTDS to iPhone
Firstly ios dosent support sql database.
If you have sql database on webserver, then you have to create webservices to perform CRUD operations.
Here is simple tutorial for webservices in ios
http://www.techrepublic.com/blog/ios-app-builder/ios-tutorial-part-1-creating-a-web-service/
High level summary:
Construct your local storage database (available sqlite libraries: TankDB (made by me), FMDB)
Create your remote database with frontend webservices for interacting with the database (REST services using PHP might be a good idea for beginners: PHP to MySQL)
Create a way for your iPhone application to communicate with the hosted frontend webservices (available library: ASIHTTP)
You would use the ASIHTTP library from the iPhone to make a REST call to your hosted php files. The "sync" logic would be in your hosted php files and on the iPhone callbacks that are receiving the data.
Keep in mind this is a very simplified overview, but I think its enough to get the ball rolling.

How to connect to a MS Access database over LAN using Delphi?

I am writing an application that extracts data from a file and then saves the data in a MS Access database. I now want to write a client for this program where users can view the data with a nice GUI. How do I connect the client on another PC to the database on my PC using Delphi? For starters I would just like to display the MS Access Data in a DB Grid. I have never worked with networking before in Delphi.
There are lots of ways to do this. One simple way is just to set up an ODBC connection to the database (using ODBC administrator). It doesn't matter if this database is over the network - just map a drive or use a fully qualified name.
You then have a choice of components you can use to connect to the database. ADO is a good choice for Access. For starters try using a TADOQuery, TDataSource and data aware component such as a TDBGrid. There is plenty of documentation on how to uses these in the delphi help.

Why doesn't Microsoft support OLE DB connections to SQL Azure?

At the MSDN website it says, "Connecting to SQL Azure by using OLE DB is not supported."
There are other places on the web where folks report that it works fine for them after tweaking the server name in the connection string, such as here and here. Even SQL Server's Analysis Services uses OLE DB to connect to SQL Azure!
I develop a native/unmanaged application in Delphi that connects to SQL Server using ADO through the OLE DB provider for SQL Server. I'm considering adding SQL Azure support. It would be really helpful if I could reuse the majority of my code without not too much change. I probably wouldn't consider going this direction otherwise.
It would be helpful if Microsoft were more clear on why "OLE DB is not supported". If there are certain limitations within the use of OLE DB, what are they? Maybe I can work around them, or maybe it wouldn't affect me.
Microsoft also mentions that ODBC is supported. So could I use the "OLE DB provider to ODBC" and connect this way? Or is any combination that includes OLE DB "not supported"?
You can use it, however it has not been thoroughly tested for all cases. Essentially, it should work for most things, but there might be a few edge cases where it won't work. Until we document those cases, it remains unsupported. That being said, if you were to use and run into errors, we would love to know about it and prioritize that to be fixed.
Vote for the OleDB support for Azure here:
http://www.mygreatwindowsazureidea.com/forums/34685-sql-azure-feature-voting/suggestions/407269-ole-db-provider-for-connecting-to-sql-azure?ref=title
You can use ADO using the SQL Native Client although this information is hard to find you can read about it here http://msdn.microsoft.com/en-us/library/ms130978(SQL.110).aspx and here http://msdn.microsoft.com/en-us/library/ms131035(SQL.110).aspx.
In the connection string instead of using Provider=SQLOLEDB; we can use Provider=SQLNCLI10;. Also it is recommended to use DataTypeCompatibility=80;. So a SQL Native Client supported connection string would look like this:
"Provider=SQLNCLI10;Server=tcp:MyServerName.database.windows.net;Database=AdventureWorks2008R2;Uid=MyUserName#MyServerName;Pwd=MyPa$$w0rd;Encrypt=Yes;DataTypeCompatibility=80;"
You can also add "MARS Connection=True;" to the connection string for multiple recordsets.

Resources