load the mysql driver in android emulator - mysql

how to load the mysql server in android emulator
i.e
Class.forName("com.mysql.jdbc.Driver")
i got the exception java.land.ClassNotFoundException in com.mysql.jdbc.Drive
please reply me.

This assumes MySQL is publicly available from internet, but it is never good idea .
Setup public WebService and connect to it from mobile application.

You won't be able to run MySQL server on an Android device.
What you're doing, however, is trying to load the MySQL client library. That isn't included as part of Android so you cannot load it. You'd need to include the relevant JARs in your project, if you really do want to connect to a remote MySQL database from an Android app.
If you do want to store and access data on your Android device, the awesome SQLite database is included by default, including all the APIs you need to create, upgrade and otherwise interact with SQLite databases.

When I did this I created PHP files for the database operations. I sent data in XML and received data in XML all using PHP scripts. I found this to be the easiest way for me...but you need to know PHP of course.

Related

React Native Local Database Sync with Mysql

Is possible to Offline sqlLite saved data send or sync with live MySQL database in server side ?
I found my own solution to this scenario.
I try to build up React Native mobile app working with Laravel backend(PHP) and my app working online and offline both. So my mobile app using Realm (of MongoDB) to app db and MySQL in severe side (Laravel). I create the flag field in both dbs to know that row is sync or not and i develop the function to check that flag field and sync to both db and update flag field as my wish. You can try this with SQLite or any other mobile db.
Realm:https://docs.mongodb.com/realm/
The most easy way to do so is to use WatermelonDB.
See: https://github.com/Nozbe/WatermelonDB
It provides a syncing option from which you can automatically sync your database with the backend. It uses SQlite on it back. For synchronisation see:
https://nozbe.github.io/WatermelonDB/Advanced/Sync.html

How to access server MySQL database from iOS app

I'm trying to write an iOS app using Xcode.
A simple login prompting username and password.
I have no idea how to open a database connection to validate the username and password.
The database I use is mysql.
I tried using this link http://macbug.org/macosxsample/mysql#.Ur8AYBbtGPF
but I get an error when I tried to add libmysqlclient.a to the frameworks and library.
If your database is on a server somewhere, then you would generally not have your iOS app interact directly with the database server, but rather you would write a web service that the app would interact with (via NSURLConnection, NSURLSession or something like AFNetworking), and the web service would interact with the MySQL database.
In terms of how to write a web service, often, when people are writing their first web service, they'll use some simple technology like PHP. Do you know what options you have on your server? If PHP is an option, then you can check out Ray Wenderlich's How to Write a Simple PHP/MySQL Web Service. Then check out How to Write an iOS App that Uses a Web Service.
You should use SQLite instead of MySQL for iOS application. You are referring MacOSX application tutorial. try this http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app

connecting an ios app to send information to a mysql database

Im doing my final project which is a taxi booking service. i intend to make an ios app for the customer so that they can book a taxi. the request will then be sent to the mysql database (held at the taxi base). i want to no how can i send the information from the app to the datatbase; and the datatbase to send a confirmation message back to the app confirming the taxi has been booked!>>>>>
i have read a lot about web servers but am very confused. can i use an web server e.g. windows home server 2008? any help would be appreciated.
I am not familiar with Windows home server 2008, but I'm pretty much sure that you can use it for your project.
If you want to keep things simple,
Just install XAMPP server which comes with all the components you need to work on this project including PHP and MySQL. It is one of the easiest servers to work with and most of all, its free and open source. http://www.apachefriends.org/en/xampp-windows.html
Then write the business logics inside your Web App using whatever the programming language you want to (for this one PHP would be enough, or choose Java if you want to have a more complex scalable solution). Writing data to a MySQL database using PHP is very easy and you can find ton of tutorials and sample source codes in the internet.
Now your web app is all set, the next step is to expose these services using REST where an iPhone can communicate with your services. Use JSON for interacting with your Web server from iPhone. Again, there are tones of tutorials on how to write a JSON RESTful service using PHP.
Finally in your iPhone app, you can access the service exposed from the server for saving data as well as to retrieve anything from it through JSON. For making this, use a good Objective-C framework such as AFNetworking. It comes with the JSON parser as well. Ref. http://afnetworking.com
Good luck with your project !
RESTful web services are going to be your best friend here.
Create a server side program in django or python or whstever. Connect it to a database (mysql).
You can host it on Amazon Web Services. I think they have windows 2008 instances. I would personally use the amazon linux ami.
Use afnetworking to invoke a get or a post on the server app and you are off to the races.
take a look at this open source taxi project
its work with RESTful web services but its better to forget about Microsoft Windows its better to use Linux hosting for your web service.

How do I allow a user to install MySQL on a user's machine more easily so they can connect to it via a Java application?

Let's say I have written an application in Java that is programmed to use a MySQL database. The user of the Java application needs to have MySQL on their machine in order for the application to work.
What can I do to make sure that the user has the correct version of MySQL on their machine and if they don't then install it so they can properly run the Java application?
Note: I had sent some links to setup Java and MySQL for a business analyst of a program I am working on and he was not able to decipher the madness that is installing MySQL. He is not computer technical and wouldn't even know what to enter into the forms of the MySQL installation. What could I do to ease this task for the end user?
Update: Unfortunately, for security reasons that are a requirement for this project we have to use MySQL and not SQLite or Derby. Unless there is a way to make sure that no one deletes the SQLite database file or switches it out for another one. We need to guarantee data integrity and I find that using MySQL gives me the best chance at doing that.
What is the target platform?
Assuming something UNIXish, you can either:
1) Include a shell script to download, install, and setup mysql. Complicated, but not impossible.
2) Use an embedded Derby database. On my current project, we have a version where the user can just "download and go." That version uses an embedded Derby database that writes to a file, similar to hsqldb or sqlite3. Any of those are fine options.
The easiest thing for the user is to embed the database in the Java application. No setup required. There's MySQL OEM (not free), so you might consider switching to SQLite instead, which is the de facto standard embedded database. (See this question for more on that.)

Online music Streaming with GWT

I need to develop an application that is hosted in Google App Engine and access mysql database that is hosted in separate server which is not enable RMI or tomcat installed. Data(music files) stored in same server and for music files paths are stored in mysql database. Users can select music category and play them.
Just like - http://www.the-music-collective.com/listen/MP3Player.html
![alt text][1]
My questions are,
What technology I can use to access the mysql database?
Can I upload music files to the server via client interface?
The site you mentioned is using this javascript library:
http://www.schillmania.com/projects/soundmanager2/
and it's wrapped with GWT by JSNI or by library mentioned by stan229: http://code.google.com/p/gwt-sound
You can read more about this here:
http://googlewebtoolkit.blogspot.com/2009/03/giving-your-gwt-application-voice.html
Add 1) According to this two questions:
Can I use a MySQL database with an App Engine applicationand this:
App Engine and MySQL
you can't connect to a mysql database directly, but you can expose web service that will connect you with db.
Add 2) Yes you can upload any files through client. You can use this widget:
com.google.gwt.user.client.ui.FileUpload or this library: http://code.google.com/p/gwt-upload/
Well, you need something server-side. Why not PHP? Will they let you have PHP on that server? You could then write a simple script to give you feeds of data you need. Just be careful and secure it.
Regarding uploading music, you can handle this with PHP as well.
For the Client you will need something like GWT-Sound http://code.google.com/p/gwt-sound/
For the URL you would need to call some kind of server that returns the stream of data from mysql on a GET