tags:

views:

55

answers:

2

Is there any way to connect mysql database with dojo web pages. Kindly give me some guide lines so that I can make it possible.

+1  A: 

AFAIK not without any serverside component (Servlet, PHP etc.)

er4z0r
What I mean is, that dojo as a JS-Toolkit has no means (to my knowledge) to directly connect to a database. If you want to retrieve data from a database, you should do so by using code that runs on the server side and is called by your dojo-scripts using AJAX.
er4z0r
A: 

Dojo is a Javascript toolkit. When running in the browser, you will need some sort of adapter on the server to communicate with a sql database, usually through some sort of abstraction. It's considered bad practice to do anything which would pass through sql requests from client javascript code for security and probably for other reasons. Very often, a simple "web service" (servlet, php script, etc.) would service requests, read from the database and emit data to the client over HTTP in JSON, XML or some other format.

That said, Dojo does provide some abstractions beyond that. dojo.data provides an API for data access from Javascript which abstracts the data source, and it is used by various Dojo widgets including the dojox.grid. Take a look at QueryReadStore which comes with a sample PHP implementation.

peller