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 TKWMGrandMotherRS extends TKWMAllNodesSelector { 10 11 public boolean checkSelection( ) { 12 return false; 13 } 14 15 public String getSelectionData( TKHashtable params ){ 16 return ""; 17 } 18 19 public TKVector getSelectionNodes(String selectionData, int siteNodeId ) 20 throws SQLException 21 { 22 TKVector nodes= new TKVector(); 23 int grandMotherNodeId; 24 TKQuery query; 25 ResultSet rs; 26 27 query = TKDBManager.newQuery(TKWMDBGrandMotherNode.class); 29 query.setQueryParams("SITE_NODE_ID", new Integer (siteNodeId)); 30 query.execute(); 31 rs = query.fetchResultSet(); 32 33 if (rs != null) { 34 if (rs.next()) { 35 grandMotherNodeId = rs.getInt("SITE_NODE_PARENT"); 36 } else { 37 return nodes; 38 } 39 } else { 40 return nodes; 41 } 42 43 query = TKDBManager.newQuery(TKWMDBSisterNodes.class); 45 query.setQueryParams("SITE_NODE_ID", new Integer (grandMotherNodeId)); 46 query.execute(); 47 rs = query.fetchResultSet(); 48 49 if (rs != null) { 50 while (rs.next()) { 51 nodes.addElement(new Integer (rs.getInt("SITE_NODE_ID"))); 52 } 53 } 54 return nodes; 55 } 56 57 public TKDBResult getSelectionValues( String selectionData, int siteNodeId ) 58 throws SQLException 59 { 60 TKDBResult values=null; 61 int grandMotherNodeId = 0; 62 TKQuery query; 63 ResultSet rs; 64 query = TKDBManager.newQuery(TKWMDBGrandMotherNode.class); 66 query.setQueryParams("SITE_NODE_ID", new Integer (siteNodeId)); 67 query.execute(); 68 rs = query.fetchResultSet(); 69 70 if (rs != null) { 71 if (rs.next()) { 72 grandMotherNodeId = rs.getInt("SITE_NODE_PARENT"); 73 } else { 74 ; } 76 } else { 77 return values; 78 } 79 80 query = TKDBManager.newQuery(TKWMDBRSSisters.class); 81 query.setQueryParams("SITE_NODE_ID", new Integer (grandMotherNodeId)); 82 query.execute(); 83 rs = query.fetchResultSet(); 84 85 if (rs != null) { 86 values = new TKDBResult(rs); 87 } 88 return values; 89 90 } 91 92 } 93 94 | Popular Tags |