KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > lib > TKResultSetIterator


1 /*
2  * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/lib/TKResultSetIterator.java,v 1.6 2001/03/06 14:57:24 alex Exp $
3  *
4  */

5 package com.teamkonzept.lib;
6
7 import java.sql.*;
8
9 //--------------------------------------------------------------------------------//
10
//--------------------------CLASS TKDBListIterator--------------------------------//
11
//--------------------------------------------------------------------------------//
12

13 public class TKResultSetIterator implements TKListIterator {
14
15     protected TKListIterator oldIterator;
16     protected String JavaDoc listName;
17     protected ResultSet resultSet;
18     public TKResultSetIterator( ResultSet resultSet, TKListIterator oldIterator, String JavaDoc listName )
19     {
20         this.oldIterator = oldIterator;
21         this.listName = listName;
22         this.resultSet = resultSet;
23     }
24     
25     public boolean apply( TKTemplate template, int i, String JavaDoc currListName )
26     {
27         if( currListName.equalsIgnoreCase( listName ) ) {
28             return TKDBTemplate.prepareTemplate(resultSet,template );
29         }
30         else if( oldIterator != null ) {
31             return oldIterator.apply( template, i, currListName );
32         }
33         else {
34             return false;
35         }
36     }
37     
38 }
39
40
Popular Tags