sync sqlite database from server database (mysql) in iphone sdk - iphone

I am using SQLite database in iPhone application. I want to sync application SQLite database from MySQL server database.
Any ideas about how to do this?

Implement a webservice to provide data on the server, then deploy a client to consume the service. In your application you may use the WSClient++ (http://wsclient.neurospeech.com/) or some other API.

Related

Existing db2 database in liberty worksphere app in bluemix

I have deployed a Worksphere Liberty project from eclipse to Bluemix. Now I want to connect it with an existing Db2 database. What are the steps to follow?
Check out the example app Java DB Web Starter. It uses a DB2 database in Bluemix.
Does your existing database have a URL which is accessible from the internet? If so, you can directly talk to the database from your Bluemix application.
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection connection = connection = DriverManager.getConnection("jdbc:db2://localhost:50000/yourdb", "username", "pwd");
Be sure to package the db2 driver jar in your WEB-INF/lib.
If your datasource definition is already defined in a Liberty server.xml config, you can push the entire liberty server pacakge.
If your existing database is behind a company firewall, look at the Secure Gateway to expose the connection securely.
Assuming you need to connect to an existing DB2 database that resides on-premises (outside of Bluemix), you would need to use the Bluemix Cloud Integration service. With it, you can move data or create REST APIs for Bluemix applications to access and use.
https://www.ng.bluemix.net/docs/#services/CloudIntegration/index.html#gettingstartedwithcloudintegation

How to establish connection between db and java code in bluemix

I am making a web application in bluemix and for that, I chose java db web starter as boiler plate. I made html files in eclipse and I want db connectivity. I made a table in database (viz userInformation), but I am not getting that where and what code should be written to establish connection. Please help.
If you're deploying a Liberty application, and using the SQLDB service, the connection information and the db driver jar should be automatically configured in the server.xml and a datasource is created for you. You can access it using JNDI. Take a look at this example:
https://developer.ibm.com/bluemix/2014/02/07/java-db2-10-minutes/
Your other option is to parse the VCAP_SERVICES environment variable and read the connection information out of it. Example: https://github.com/IBM-Bluemix/get-started-java
The Bluemix documentation has a lot information on how to make the connection for each services.
Also, you will need to have some server side java code like a Servlet to make this db connection. You can not connect directly from your client side html code.
https://github.com/IBM-Bluemix/java-db

What is the backend of the mobiledata service of Bluemix?

I analyzing if I use or not the mobiledata of Bluemix to my app, but I could not find what is the DB engine behind its Solution.
Anyone know what is the backend of mobiledata service of Bluemix?
Backend of mobile data service of bluemix is cloudant.For details please refer below link on getting started:
https://www.ibm.com/developerworks/cloud/library/cl-rapiddev-app/
Backend of mobile data service of bluemix uses Cloudant NoSQL Database for Bluemix as datastore.
It actually uses Cloudant behind the scenes. Cloudant is based on CouchDB and adds Lucene Indexes as well.
Basically, you can select any database service available on Bluemix to store your data. It depends on type of application and data to be stored. If you need to store relational data, go for a SQLDB service. If your mobile application need to store JSON data, then you need a NoSQL database service available on Bluemix. Cloudant is a good NoSQL database and most developers use it as a mobile data backend service.

database authentication with cas server module

I am in process of implementing SSO for two web-applications (both jsp-servlet MVC based).
The user credentials in sqlite database "App1.db" within table LOGIN(USERNAME,PASSWORD).
CAS's official page mentions support for MySql and oracle ,but nowhere it mentions non-compatibility with "other" databases .So, is there a way to integrate this sqlite database with CAS server module for authentication ?
Most of the CAS Server documentation is community driven. The authors of the page you referenced have worked with MySQL and Oracle. I personally have connected it up to Microsoft SQL Server without issue... because it uses JDBC.
CAS JDBC Authentication Handler uses Spring and JDBC. JDBC is generic by design. So if your sqlite database has a JDBC driver, then you should be good to go.

How can i use MYSQL database connection in iphone application useing cocos2d?

I am working on project and i need to connect MYSQL database. I am success to connect SQLite in my project ( using cocos2d).But i can not connect MYSQL database in my project.
I any one do like this than help me for how to connect . Give me the necessary information.
You will not be able to connect to MySQL directly from the iPhone. You must use some intermediate layer such as a Web application with PHP.
So, you will have something like this:
iPhone POSTING a request to the WebServer using HTTP
Web Server connecting to the MySQL database
Web Server returning data to the iPhone (XML, plain text)
iPhone processing the data
You can use this technique to query and insert/update/delete data.
This site contains a libmysqlclient.a file compiled for the iphone (arm).
http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/