phonegap and query database