[Jslib] SQL XPCOM Methods

Gordan Bobic gordan at bobich.net
Wed Mar 30 15:36:39 EST 2005


Hi,

I'm trying to use jsLib to get access to SQL database connectivity 
features, but I'm not having much luck at the moment. I installed the 
relevant XPIs for SQL.

I found methods jslibGetService() and jslibCreateInstance(), and my best 
guess as to what I should be doing is this:

==================
$ ./run-mozilla.sh xpcshell
js> JS_LIB_DEBUG=true;
true
js> load ("chrome/jslib/jslib.js");
*** load: debug.js OK

*********************
JS_LIB DEBUG IS ON
*********************

js> var wm = jslibGetService("@mozilla.org/appshell/window-mediator;1", 
"nsIWindowMediator");
==================

That works fine. However:

==================
$ ./run-mozilla.sh xpcshell
js> JS_LIB_DEBUG=true;
true
js> load ("chrome/jslib/jslib.js");
*** load: debug.js OK

*********************
JS_LIB DEBUG IS ON
*********************

var obj = jslibCreateInstance("@mozilla.org/sql/service;1", 
"mozISqlService");

-----======[ jsLib ERROR ]=====-----
FileName:          undefined
Result:            NaN
Message:           jsC.classes[aURL] has no properties
LineNumber:        undefined
-------------------------------------

js>
==================

How do I use the SQL libraries?

Many thanks.

Gordan


More information about the Jslib mailing list