1 |
|
# |
2 |
|
# This file is part of GNU Enterprise. |
3 |
|
# |
4 |
|
# GNU Enterprise is free software; you can redistribute it |
5 |
|
# and/or modify it under the terms of the GNU General Public |
6 |
|
# License as published by the Free Software Foundation; either |
7 |
|
# version 2, or (at your option) any later version. |
8 |
|
# |
9 |
|
# GNU Enterprise is distributed in the hope that it will be |
10 |
|
# useful, but WITHOUT ANY WARRANTY; without even the implied |
11 |
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
12 |
|
# PURPOSE. See the GNU General Public License for more details. |
13 |
|
# |
14 |
|
# You should have received a copy of the GNU General Public |
15 |
|
# License along with program; see the file COPYING. If not, |
16 |
|
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
|
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
|
# |
19 |
|
# Copyright 2000-2003 Free Software Foundation |
20 |
|
# |
21 |
|
# FILE: |
22 |
|
# appserver/ResultSet.py |
23 |
|
# |
24 |
|
# DESCRIPTION: |
25 |
|
# Implementation of dbdriver for use with GNUe Application Server. |
26 |
|
# |
27 |
|
# NOTES: |
28 |
|
# |
29 |
|
# HISTORY: |
30 |
|
# |
31 |
|
|
32 |
|
from gnue.common.datasources import GConditions, Exceptions |
33 |
|
from gnue.common.datasources.drivers.Base import ResultSet as BaseResultSet |
34 |
|
from gnue.common.apps import GDebug |
35 |
|
from gnue.common.rpc import GComm |
36 |
|
|
37 |
|
import string |
38 |
|
import types |
39 |
|
import md5 |
40 |
|
import sys |
41 |
|
|
42 |
|
from RecordSet import * |
43 |
|
|
44 |
|
# |
45 |
|
# Notes: |
46 |
|
# In the Appserver driver a CURSOR is simply the List handle returned |
47 |
|
# via the query interface |
48 |
|
# |
49 |
|
class ResultSet(BaseResultSet): |
50 |
|
|
51 |
|
_recordSetClass = RecordSet |
52 |
|
|
53 |
|
def _loadNextRecord(self): |
54 |
|
|
55 |
|
more = 0 |
56 |
|
if self._cursor: |
57 |
|
|
58 |
|
# load next records into local cache |
59 |
|
|
60 |
|
instances=self._cursor.fetch() |
61 |
|
for i in instances: |
62 |
|
|
63 |
|
more = 1 |
64 |
|
|
65 |
|
record=self._recordSetClass(parent=self,initialData=i) |
66 |
|
|
67 |
|
self._cachedRecords.append (record) |
68 |
|
|
69 |
|
self._recordCount=self._recordCount+1 |
70 |
|
|
71 |
|
# if no record returned return a zero |
72 |
|
return more |
73 |
|
|
74 |
|
|