1 package com.teamkonzept.webman.refsel; 2 3 import java.sql.*; 4 5 import com.teamkonzept.db.*; 6 import com.teamkonzept.lib.*; 7 import com.teamkonzept.webman.refsel.db.queries.*; 8 9 public class TKWMGreatGrandMotherRS extends TKWMAllNodesSelector 10 { 11 12 public boolean checkSelection( ) { 13 return false; 14 } 15 16 public String getSelectionData( TKHashtable params ){ 17 return ""; 18 } 19 20 public TKVector getSelectionNodes(String selectionData, int siteNodeId ) 21 throws SQLException 22 { 23 TKVector nodes= new TKVector(); 24 int greatGrandMotherNodeId; 25 TKQuery query; 26 ResultSet rs; 27 28 query = TKDBManager.newQuery(TKWMDBGreatGrandMotherNode.class); 30 query.setQueryParams("SITE_NODE_ID", new Integer (siteNodeId)); 31 query.execute(); 32 rs = query.fetchResultSet(); 33 34 if (rs != null) { 35 if (rs.next()) { 36 greatGrandMotherNodeId = rs.getInt("SITE_NODE_PARENT"); 37 } else { 38 return nodes; 39 } 40 } else { 41 return nodes; 42 } 43 44 query = TKDBManager.newQuery(TKWMDBSisterNodes.class); 46 query.setQueryParams("SITE_NODE_ID", new Integer (greatGrandMotherNodeId)); 47 query.execute(); 48 rs = query.fetchResultSet(); 49 50 if (rs != null) { 51 while (rs.next()) { 52 nodes.addElement(new Integer (rs.getInt("SITE_NODE_ID"))); 53 } 54 } 55 return nodes; 56 } 57 58 public TKDBResult getSelectionValues( String selectionData, int siteNodeId ) 59 throws SQLException 60 { 61 TKDBResult values=null; 62 int greatGrandMotherNodeId = 0; 63 TKQuery query; 64 ResultSet rs; 65 query = TKDBManager.newQuery(TKWMDBGreatGrandMotherNode.class); 67 query.setQueryParams("SITE_NODE_ID", new Integer (siteNodeId)); 68 query.execute(); 69 rs = query.fetchResultSet(); 70 71 if (rs != null) { 72 if (rs.next()) { 73 greatGrandMotherNodeId = rs.getInt("SITE_NODE_PARENT"); 74 } else { 75 ; } 77 } else { 78 return values; 79 } 80 81 query = TKDBManager.newQuery(TKWMDBRSSisters.class); 82 query.setQueryParams("SITE_NODE_ID", new Integer (greatGrandMotherNodeId)); 83 query.execute(); 84 rs = query.fetchResultSet(); 85 86 if (rs != null) { 87 values = new TKDBResult(rs); 88 } 89 return values; 90 91 } 92 93 } 94 95 | Popular Tags |