Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sony123

macrumors newbie
Original poster
Apr 14, 2012
24
0
Hi, I am student and need some help about swift with sql.

I have some experience with java + mysql. I am just learning swift and programming for iOS devices.

Now I need programing some application on iPad/iPhone and I need connecting to data from different iOS devices.

Im thinking about how realize this.

Have you any idea?

Sorry for my English :)

Thanks
 
Hi, I am student and need some help about swift with sql.

I have some experience with java + mysql. I am just learning swift and programming for iOS devices.

Now I need programing some application on iPad/iPhone and I need connecting to data from different iOS devices.

Im thinking about how realize this.

Have you any idea?

Sorry for my English :)

Thanks

Glad to help, but I dont understand completely. Do you want an app that connects to other phones and gets data?
 
Glad to help, but I dont understand completely. Do you want an app that connects to other phones and gets data?

I need to make an multi agent application. It must by possible log on by doctor or nurse. Doctor can set medicine by this application for many patients. Patients can check feed pills from their iOS device with this application.

This is only for my bachelor thesis.

Is it possible use SQL with swift? Or u must use only core data. But this data is saved only on one device and I cant access or update feed pills remotely.

Thanks.
 
I need to make an multi agent application. It must by possible log on by doctor or nurse. Doctor can set medicine by this application for many patients. Patients can check feed pills from their iOS device with this application.

This is only for my bachelor thesis.

Is it possible use SQL with swift? Or u must use only core data. But this data is saved only on one device and I cant access or update feed pills remotely.

Thanks.

What you’re going to want to do is build a web/cloud based API, that handles authentication, centralizes the data, applies various access control logic, etc.

You likely wouldn’t be dealing the DB directly (i.e., Swift/Obj-C to DB), but via an application layer - it’s this layer that will handle the data access, and you _probably_ want to return the data in JSON - it’s structured, easily consumed on the iOS side, and very lightweight.

Build it using a RESTful approach and it’s easily consumed from iOS, Android and the web.

Also, when you say “SQL”, I’m assuming you mean a relational database, because I’m not sure you’d want to use MS/SQL for storage, vs. Postgres or mySQL ... but, I don’t know what resources you have available.
 
Didn't Apple say something about iCloud storage at WWDC that could be used to share databases between devices running the same iOS application? That seems like it would be the easiest path to take to me. It'll require iOS 8, which is currently in beta, but assuming your project isn't due until later in the Fall that should be fine.
 
Didn't Apple say something about iCloud storage at WWDC that could be used to share databases between devices running the same iOS application? That seems like it would be the easiest path to take to me. It'll require iOS 8, which is currently in beta, but assuming your project isn't due until later in the Fall that should be fine.

Yeah, there's iCloud + CloudKit, sounds pretty promising for people who don’t want to write their own backend:

https://developer.apple.com/icloud/index.html
 
The question is a little vague so I'll try to answer broadly.

sqlite is built-in on the device. See sqlite.org
sqlite has a C API but there is an Objective-C interface to sqlite called FMDB. See https://github.com/ccgus/fmdb

If you need remote data access then you need a web service. There is nothing really like jdbc. REST is the way to talk to your remote db. Before building my own web service I would look at existing services. Look at

Mongolab.com
Parse.com

and there are others.
 
  • Like
Reactions: DeepIn2U
The question is a little vague so I'll try to answer broadly.

sqlite is built-in on the device. See sqlite.org
sqlite has a C API but there is an Objective-C interface to sqlite called FMDB. See https://github.com/ccgus/fmdb

If you need remote data access then you need a web service. There is nothing really like jdbc. REST is the way to talk to your remote db. Before building my own web service I would look at existing services. Look at

Mongolab.com
Parse.com

and there are others.
Couldn't you just build your own api in NodeJS/Express and MogoDB for a backend and DB?
 
You can build a web service in many different ways. If you are coming on this forum to ask how to talk to a db then answering 'build your own web service' probably isn't what you wanted to hear.

If you already know how to build a web service then that might be a good solution for you. For the rest of us, using one of the existing services that I mentioned is probably better. But really it's up to OP to decide what works best for them.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.