Prev | Current Page 531 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Besides, thanks to the great
set of cross - database libraries that come with haXe, it makes little difference which database server you
choose to run the examples with.
Connecting to the Database
Connecting to a database is one of the few times that you ??™ ll need to write differing code depending on
the target database, simply because most databases require a differing connection string. Once
connected, though, it ??™ s pretty much plain sailing as you ??™ ll find almost all other functionality identical.
Connecting to a SQL ite Database
Connecting to a database requires a single line of code, regardless of the database you ??™ re using, though
the parameter requirements do differ quite considerably. For instance, SQLite, being a file - based
database, only requires you to pass a single parameter value for the location of the database file. You do
this when calling the static open method of the neko.db.Sqlite class, which in turn returns an
implementation of the neko.db.Connection interface required for all future database queries:
var conn = neko.


Pages:
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543