283
Chapter 11: Performing Server-Side Trickery
The ResultSet Class
Each database supported by the haXe language also makes use of a ResultSet class that implements
neko.db.ResultSet . It is the primary purpose of this class to act as a container for any data that should
return from an executed query and, thus, provide means of access to that data.
Table 11 - 3 details the methods of the neko.db.ResultSet interface:
Table 11-3
Method Description
length () : Int Returns the number of records from a select, update, or delete query
nfields () : Int Returns the number of columns in the ResultSet
getFloatResult( val
: Int ) : Float
Returns a value as type Float from a given column index
getIntResult( val :
Int ) : Int
Returns a value as type Int from a given column index
getResult( val : Int
) : String
Returns a value as type String from a given column index
hasNext() : Bool Facilitates the Iterator interface
next() : Dynamic Facilitates the Iterator interface
results() :
List
Returns the ResultSet content as a List object
Accessing Fields by Name
When records are returned in a ResultSet object, any values with an associated column name
referenced within the returned data is appended to the object as accessible properties.
Pages:
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556