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

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/

Related

How should I build a server for mobile-apps

I'm planning to build an application that will include users registration and so on.. I want to build a kind of social network application and i wonder how should I build my server and what is the right way to connect between the application and the server?
I know to build clients and servers in python and connect between them with sockets, but I realise that this is not the right way to do it in mobile applications..
someone told me I should learn something called SOA or web application server , I did not understand him so well,
I hope that you understand what I search for, thanks!
A good start is to create a REST-based backend service that exposes methods/operations via HTTP. Host the service on your server, and allow the app to communicate with the service. This service can send and receive data, typically in the JSON format, between the service and your app(s). Try looking here for some examples:
Python: https://www.sitepoint.com/building-simple-rest-api-mobile-applications/
.NET: https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api

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

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.

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

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.

How to test connectivity to couchbase server using .NET sdk?

I'm trying to test connectivity to couchbase server using the .NET sdk.
I've tried to get a test key in order to do it, but I'm getting "null" (instead of getting an exception mention that couchbase server is done).
I've also read this:
http://www.couchbase.com/docs//couchbase-manual-2.0/couchbase-getting-st...
But it doesn't say anything about testing connectivity from an application code.
Is there any way of testing connection to couchbase server via code ?
The couchbase client sdk manages the connections for you, whatever node urls you pass to it during construction it attempts to authenticate to, if the client can't authenticate to one of the nodes then it throws ConnectException (I'm using the JAVA sdk but I imagine .NET is very similar).
So really you don't have to test the connectivity, the smart client handles that. After construction you can ask the client to list all the available servers
client.getAvailableServers();
Or for a more detailed status of your nodes and statistics do:
client.getStats();