views:

1596

answers:

3

Hi all,

I have a large array of vehicle make and model data that I want to dynamically display on a web page. For example, when you select a vehicle make from a drop down menu the vehicle model dropdown is dynamically populated with an asynchronous call.

I would normally execute this with an AJAX call to a PHP script that would return the desired data from a server side database.

To remove the need for a PHP helper script, I would like to directly call a server side SQLite database.

Everything seems to indicate that server side SQLite databases are not meant to be queried with Google Web Toolkit or JQuery.

Is it possible to use a server side SQLite databases with Google Web Toolkit or JQuery?

Thanks as always!

A: 

You might want to check out Google Gears. It integrates GWT and SQLite, so it might give you some clues and some sample code as to how this might work with an online application:

Google Gears is a library that enables your web applications to work offline. Currently it consists of three modules: LocalServer for caching and serving up your web app resources (ie. html, javascript, images), a SQLite Database for storing offline data, and a WorkerPool for performing asynchronous operations.

http://www.gwtsite.com/getting-started-with-gwt-and-google-gears/

Robert Harvey
Thanks for the tip :)
dbasch
A: 

a couple of datapoints:

  • both GWT and jQuery ultimately execute as JavaScript inside the browser. they don't have any access to the network stack beyond being able to initiate AJAX requests (HTTP).

  • SQLite isn't a server, it's a library embedded inside an executable. Most modern scripting languages (like PHP, Python, Ruby, etc) embed it in some library (either core or external).

  • both HTML5 and Google Gears use SQLite to provide client-side data storage to client-side JavaScript apps; but it's all running inside the browser and therefore fully client-side.

so.... there's no 'direct' route between GTW/jQuery to server-side SQLite

Javier
You are correct. I should not have been calling SQLite a server.It looks like I will need to write a PHP glue script to facilitate the AJAX calls from the browser.Thanks!
dbasch
A: 

There is a JDBC driver for SQLite, so you can provide (abstracted) access to this via GWT's RPC.

David Easley