[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/utils DB.java,1.9,1.10
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-09-16 15:19:45
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory usw-pr-cvs1:/tmp/cvs-serv11935/dev/src/net/sourceforge/idrs/utils
Modified Files:
DB.java
Log Message:
Added data paging support, fixed hot deployment bug
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DB.java 9 Sep 2002 21:27:44 -0000 1.9
--- DB.java 16 Sep 2002 15:19:42 -0000 1.10
***************
*** 96,99 ****
--- 96,103 ----
this.cursur = DB.CLIENT;
}
+
+ public int getNumberRows() {
+ return rows.size();
+ }
***************
*** 128,131 ****
--- 132,136 ----
public void setNumRecs(int recs) throws Exception {
this.numRecs = recs;
+ this.cursur = DB.CLIENT;
}
***************
*** 493,503 ****
*/
private void readTable() throws Exception {
!
if (this.cursur == DB.CLIENT) {
! //System.out.println("Client cursor");
rows = new LinkedList();
while (rs.next()) {
this.fields = new HashMap();
! readFields();
rows.add(this.fields);
}
--- 498,515 ----
*/
private void readTable() throws Exception {
!
Object key;
! System.out.println("in read table");
if (this.cursur == DB.CLIENT) {
! System.out.println("In Client cursor read table");
rows = new LinkedList();
+ Iterator it;
while (rs.next()) {
this.fields = new HashMap();
! readFields();
! it = fields.keySet().iterator();
! while (it.hasNext()) {
! key = it.next();
! System.out.println(key + "=" + fields.get(key));
! }
rows.add(this.fields);
}
***************
*** 615,619 ****
throw new Exception("getFieldData() can only be called when direction is OUTPUT");
! if (rs == null) {
return "";
}
--- 627,631 ----
throw new Exception("getFieldData() can only be called when direction is OUTPUT");
! if (rs == null && this.cursur != DB.CLIENT) {
return "";
}
***************
*** 701,704 ****
--- 713,717 ----
public void startWith(int location) throws Exception {
this.beginWith = location;
+ this.cursurLocation = location;
}
***************
*** 714,719 ****
if (this.cursur == DB.CLIENT) {
System.out.println("Cursor client : ");
! if (rows.size() > cursurLocation) {
! fields = (HashMap) rows.get(this.cursurLocation);
cursurLocation++;
hasNext = true;
--- 727,733 ----
if (this.cursur == DB.CLIENT) {
System.out.println("Cursor client : ");
! System.out.println("Location : " + cursurLocation);
! if ((rows.size() > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
! this.fields = (HashMap) rows.get(this.cursurLocation);
cursurLocation++;
hasNext = true;
***************
*** 792,795 ****
--- 806,811 ----
}
this.wasCached = (caches.get(this.name) != null);
+ System.out.println("Cached : " + this.wasCached);
+ System.out.println("Cache : " + caches.get(this.name));
}
|