Accessing mysql from Adobe flex/AIR - mysql

Is it possible to directly access MySql databases through an Adobe AIR/Flex
application?
If not, what is the next best alternative?

I'd have to disagree (though respectfully!) with Abdullah that building an ODBC client into AIR would "cause wierd problems and open up security issues" -- that's often how it's done (e.g., Java and .NET, both of whose runtimes package various ODBC clients) -- but both posters are right: the only way's coding some sort of a service interface into your AIR application (using Flex classes like WebService, HTTPService, and so on) and a complementary server-side interface (e.g., REST via PHP, which would then connect up with your MySQL database). For simple apps, it can be a bit of a pain, but for the moment, that's all we gots. :)
Best of luck!

I haven't tried yes but there are some projects to implement a native driver in AS3 to connect to mysql server. In the end it's just a socket connection and AIR applications are allowed to open socket.
Have a look at http://code.google.com/p/assql/

No, although AIR does have a local (client-side) SQLite database builtin. You don't really want your client apps to have direct access to the server-side database anyways, it can really cause weird problems and open security issues up. You can expose a MySQL database with web services however. This article has a really easy way of doing it.

I would not recommend accessing the database directly. I describe how I'd do it here.

IMHO, the best way to access any Database from a Flex APP (Air or Flash) is to create a webservice. After a few tryouts with PHP, i got into WSDL SOAP webservice build in C# and it´s a beauty! From C#, i got the PostgreSQL, MySQL, SQL-SERVER or Oracle anytime. And using Flex Builder, you can import the WSDL so the objects and webmethod created on the WSDL side will be created for you, with events, listenerers and objects. Try. With C# or Java or any other language, the WSDL SOAP is a great alternative.

Actually, in AIR 2.0, Adobe added NativeProcess functionality. This allows the user to exchange data between applications via the command line's stdin/stdout. The drawback is that you must compile your application as an EXE, DMG, or RPM file as this functionality is not cross platform. MySQL works wonderfully via the command line so this could be a very good option for you. Here's some links on using the functionality.
http://blog.omarfouad.com/?p=277
http://gotoandlearn.com/play.php?id=125
http://gotoandlearn.com/play.php?id=126
http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html

Related

ODBC Bridge needed for JSON / RESTful web application

I've been running in circles looking for a way to deliver data from a proprietary flat file database (based on the ProvideX platform) to a client-thick web application that makes RESTful requests and expects JSON responses.
ProvideX and Sage MAS 90 provided an ODBC driver that works for pulling tables, but I can't think of a good way to connect the dots without needing to program a bunch of server-side code.
Before I go down the path of programming custom server-side middleware, does anyone have any bright ideas, (or obvious ideas that I have overlooked)?
I am not locked into any particular architecture at the moment because we are hashing out requirements for the web application, so any ideas would be helpful.
ProvideX/Sage provides a web services module, but I can't use it because my company has refused to invest in the software module and upgrade costs. Let's not let that be a distraction, however, because I am still looking for a way to use the ODBC driver in this question thread.
ODBC-ODBC Bridges exist but all the ones I know are commercial.

Support for MS Access

I am creating a web interface for an old piece of software running on an Access 2000 DB. There is no support for the Entity Framework Model for Access. Is there a way of making a connection to work with breeze?
Try to use Ado.net, there is no support from breeze to Access
http://www.c-sharpcorner.com/uploadfile/mimrantaj/connect-to-access-database-in-C-Sharp-and-ado-net/
I like your idea of putting EF in front of SQL Server express. But if that doesn't work out, your only serious impediment is finding a way to expose access to your Access (chuckle) over HTTP.
Have you got that figured out? Maybe Web API? Because once you figure that out, it will be "easy".
You do NOT need EF for Breeze clients. EF is a convenient technology for many .NET developers ... but not everyone. All Breeze really cares about is the data.
You will need to get some some metadata describing your service model (meaning whatever you expose as client-facing objects in your HTTP service). You can produce that in many ways. EF is one way (it's easy) but you can also do it in JavaScript.

VB.Net Silverlight project and MySQL

I am an experienced web programmer that has sadly had little experience with Web Services and technologies like Silverlight - I've done a lot of PHP, Javascript, CSS and MySQL. I recently have been assigned to learn Silverlight and connect a new app to a MySQL database. After a full week of trying to get this working, I'm really hoping someone can answer these questions:
I have found the MySQL .NET Connector - am I correct that this is not compatible with Silverlight and I do not need it?
I understand I must use a Web Service for this. Can I use WCF or WCF RIA, or am I best using a more traditional web service method like REST or SOAP?
What's the best web service method for many quick queries (such as updating a search as the user types in the keywords)
Do I have to use technology like LINQ, Entity SQL, ADO.NET Framework, or a stored procedure? Is one of these the best way to do it or should I just skip them all and create a simple web service?
What's the best source to learn how to do specifically Silverlight VB.NET and MySQL and learn to do it the best way as explained above. Everything I've found (books and websites) seems to be in C#, not a Silverlight product, or just uses built in SQL Server support. Very frustrating!
For our web app, we need to be able to give the buyer not just access to our client side application via a browser but also the server side so they can OPTIONALLY host the entire product themselves. We're hoping to have one installer for them on their server (so they wouldn't have to set up php or mysql to host the product for example). If I use a VB.NET website and web service, will that deploy as just an exe or dll so the user won't have to install anything special? Is installing mysql on their servers unavoidable? Please advise.
Thank you!
Wow, lots of questions in a single question.
You can't use this from Silverlight.
WCF and WCF RIA are both technologies while SOAP and REST are protocols that are both supported by WCF. So yes.
Quick queries require good code and a well tuned database, the protocol won't be an issue.
LINQ, Entity SQL, and ADO.Net are all database access technologies and have nothing to do with web services. You'll need to build a web service and then connect it to a database using some database access technology. Which one you use depends on what backend you have.
C# is much more common. Most of the MSDN content has VB.Net as well. MySQL isn't an MS technology. You can use MySQL with Entity Framework and then expose that using WCF RIA Services.
If you use VB.Net as the server side technology they will need to be running Windows with IIS and have .NET installed. They will also have to install MySQL if they want to host it.

Develop an iOS App that gets contents from a remote DB

I am developing an education app for Kids.
The application is going to contain pictures, stories and video as well.
Including all above contents in the app will surely bloat it and hence i would like store all data on a server that will be accessed by my app.
I haven't used any remote databases (like MySQL or Oracle) with any other iOS app. In fact i am a newbie in developing such kind of apps. Can any one point me to a sample
Connecting to a remote mysql is really not recommended.
The security here is critical.
You should create a webservice and my advice to you is to make sure that the access to the webservice is restricted
The webservice can be your own "protocol" or any other well known protocol like SOAP
By your own I mean, json, csv .... or whatever.
Edit 1
The technology of your webservice should be dependent on many things.
If the system is small, and the code needs to be update very often, I would suggest to do it with PHP and some small(!) MVC framework like CI.
But if its a large system with needs of ACL (access control list) I will probably choose java with spring...
I suggest that : Do not connect to / use database directly from user application. It may causes serious security problems and your app should have native SQL drivers to connect db.
So, create a web service that receive queries from the application and response in XML, JSON or some other strings that easy to parse. This will be much easier than embed native APIs into your apps.

What are the various possibilities to use MySql in a desktop applicaion

Can MySql database be used as a back-end of a desktop application. What are the various possible ways to do it?
I would say that it would be possible, with each desktop application client connecting to a centralized mysql database, at the client site, or possibly connecting to a centralized server managed by you/your company, and like #Neil Butterworth mentioned there are various APIs/methods to use to talk to the database. However, if you are looking to embed a database with your application, I would suggest looking at sqlite instead. It is a small,lightweight relational database designed for being embedded into applications.
To add to nstehr's answer, see:
SQLite vs MySQL
How scalable is Sqlite
How do databases work internally
Yes, I have done so on more than one occasion. Build your database in MySQL, either locally or on a remote machine, and then set up your connection to the database using the appropriate API.
There is a package for connecting to a .NET application (just search .NET MySQL library and it should turn up), with Java you can use Hibernate (or any other ORM Framework) and set the dialect to whichever version of MySQL you're using in the hibernate.config file. Or you could just use ODBC/JDBC directly. I'm sure other languages have their own support.
Any application, if built well, should be able to be supported by a variety of databases, and it should not affect the application. Switching between databases should involve changing a couple of property files at most, and then testing for database-specific idiosyncrasies.
Can MySql database be used as a
back-end of a desktop application
Yes, of course - just like any other database.
What are the various possible ways to
do it?
What do you mean? Do you mean how to access the database from the app? Lots of ways - some are:
via its native C API
via ODBC
via JDBC
Which one you use will of course depend greatly on which language(s) your desktop app is written in.