This time, the parameter is passed to the static connect method of the neko.db.Mysql class:
var conn = neko.db.Mysql.connect({
host : ???localhost???,
port : 3306,
user : ???root???,
pass : ??????,
socket : null,
database : ???MyBase???
});
277
Chapter 11: Performing Server-Side Trickery
Connecting with ODBC
The ODBC driver provides a one option fits all approach by accepting a single value to its connect
method. However, the value passed will vary from database to database, so you may need to look this
up for your particular flavor of database.
var conn = neko.db.ODBC.connect( someMiscellaneousConnString );
The Connection Class
Once a connection has been made to your database, you will then perform most of your regular database
interaction using an instance of a Connection class that implements the neko.db.Connection
interface. This Connection class is where the communication between your haXe application and the
Neko database .ndll module is performed. It allows you to perform tasks such as running queries,
creating, committing, and rolling back transactions and performing simple data conversions such as
escaping illegal string characters and quotes.
Pages:
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545