db prototype for phonegap