How to download data from web server and save for core data - sql

I have an app I'm working on that will have about 500 contacts, names, email addresses, website addresses ,etc. I will be updating the contacts frequently adding new contacts, and updating emails that change. I was advised the best way to do this with core data would be to do a fetch to find the youngest record and ask my server for all the records that are even younger.
My question is how to download the youngest record from my server and save it for use with core data.
I've looked around, but dont see anything on using core data with a database stored on a server. Or am I missing something, is there another way to go about creating this app.
I need to be able to update my database frequently and for the results to reach the app user

It Really Depends on your Server Back End Structure.
Check the Following Link for Complete understanding of the Whole Process by Following Link :
How To Synchronize Core Data with a Web Service

Related

Transferring specific data from one db to another locally

Ok here is the situation. We have a client application that contains a local sql database. At any given time, they could be working in the field and may have no internet connection at all. This means they cannot sync back to the server or to anything else. Client A needs to export specific pipe information that will include data from several tables and will have to hand off this information to Client B that will continue to work on this. Client A will then need to put this information on a file and give to Client B. Client B will then need to import this pipe information into his local database.
I'm brainstorming for ideas of what could be the best solution to accomplish this?
So far querying the specific pipe information, writing to a file in xml and then importing the xml and writing to the database could be an option.
Or just querying the information and writing sql scripts that can be executed on client Bs machine.
We just can't export the entire databases information from one computer to another. It has to be only specific information the user wants to export.

Connect mobile application to existing SQL database

We have an existing SQL database which stores information which is continiously updated through a number of ways.
Now we want to launch a mobile application which uses some of the data stored in the database. However, we do not know how we can connect to this database.
Is this done via API, do some standard solutions exist?
Thank you in advance!
You app, sitting on a mobile platform (lets say a phone) would need to access the database. This will have to be over the internet, and means exposing you database to direct querying over the internet. This is not a good thing: once the database is open, then almost anyone can get to it.
The way I'd do it is put a web-based front end behind which your database can hide. You app sends an HTTP request to your web site. You can include whatever security you can dream up to authenticate that it's your app and not some random vandal. When the web site thinks it's OK, it accesses the database and returns whatever data it needs to. It might return the data as HTML, but JSON is probably better.

Accessing SQL database in iOS app

I have an SQL database stored in my server, and I want my iOS app to access it. It contains passwords and such, and I need the app to be able to download the contents. What is the best way of doing this? Thanks
Basically you have two options.
Firstly you can directly access your DB via HTTP requests and get the data that you want.
(Not the suggested way.)
Or you can create a Web service which communicates with your DB and acts as a layer between your app and db.You can either get the all data or the ones you want from DB depending on your Web service.

SQL Server : Have a delayed version of the data

We have a SQL Server 2008 R2 Enterprise a database that is populated with realtime data coming from multiple sources.
We want to have this data available as is in an internal application. However we would like to let this same data be accessed through another application (web) but in a "delayed" way.
Meaning that this application would only "see" the data as it was 5-10 or 15 minutes in the past.
Is there some out of the box way to do that? If not how would you suggest tackling that problem?
I don't think there is anything "out-of-the-box" to solve this.
The only thing I can think of is to add a datetime column to each table that should be accessed by the "other" application. That datetime needs to record the creation timestamp of the row.
Then create a view for each table that restricts the rows being returned based on the current time and the creation timestamp.
The "other" app is then only allowed access through the views.
You can clone the database every 15 minutes and let the other app use the clone. Just backup the original database and restore it with diffrent name. This way you do not need to modify the data model at all. Just make sure you create a new database first and then let the web app use it. Never overwrite the database when its in use.

How to update field from SQL database

I have a lotus notes application that has a document with a Number, and a description field.
Users reserve a series of numbers at which point documents are created. They then fill in the description and a few other things.
Once this is done they go into another, application (Qpulse; not a notes application) that stores its data in an SQL database.
They will create documents in that system with matching numbers.
Once the documents are created in that system (Qpulse) i'd like update the description field in notes.
How i've done it in the past is to have a notes agent running that does a query, looping through the results finding and updating notes documents.
Is there a better way of doing this? It would be nice to have it automatically updating.
Using an agent like you have already is IMHO the simplest solution.
Another thought comes to mind, though, if you have the database running on a domino server. It could be fairly simple to POST the update to the database using HTTP. You'd still have to write some code within Notes (an agent to receive the POST), but it might be simpler to make an HTTP call after the Qpulse application is updated.
You would send over some unique identifier (that Number field I suppose?) and the description in the POST, the agent would receive it via the DocumentContext object, and could find and update the document. This process would be initiated by some trigger on the Qpulse side.
This isn't simple, but it does avoid writing lots of code outside of Notes, and avoids trying to connect to Notes as a datasource externally.
Trying to integrate with relational database systems is a relatively common problem. But a meaningful and straight forward example seems elusive. I would recommend trying JDBC. There are a few tutorials out there. Perhaps this or this will help get you started.
You could try the Lotus Connectors LotusScript Extension Classes. There is API help documentation in you Domino Designer client. I have also found this IBM Lotus Connectivity Redbook useful, despite it being 10 years old.