dboo::odb::host

dboo::address_t host();
host() : String

Returns the host name of the current connection.

Parameters

(none)

Return value

The host name of the host the connection is opened to. Undefined if not connected.

Example

int main() {

    dboo::odb db;

    db.connect("localhost", 8823,
              "my_database",
              "usr132",
              "password");

   std::cout << "Host: " << db.host() << std::endl;
}
const dboo = require('dboo');
dboo.argv(process.argv);

const config = require('config');

dbConfig = config.get('dbConfig');

dboo.init();

const db = new dboo.odb();
db.connect(dbConfig.host, Number(dbConfig.port),
            dbConfig.dbName, dbConfig.webUserName,
            dbConfig.webUserPwd);

console.log("User id " + db.host());