Javascript DB Close

From FreeSWITCH Wiki
Jump to: navigation, search

This method closes your DB connection. Please note that as soon as a script finishes executing the engine will automatically close up any CoreDB resources. This close method was designed to help you free up those resources for your longer running scripts.

Synopsis

DB.close

Example

use("CoreDB");

var DB = new CoreDB("js");
var sql="select * from users;";
DB.prepare(sql);
while(DB.next()) {
   hash = DB.fetch();
   console_log("name = " + hash["name"] + " number " + hash["did"] + "\n");
}
DB.close();
//Do Some other stuff here. 

See Also