1 package com.daffodilwoods.rmi; 2 3 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata._SelectColumnCharacteristics; 4 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata._RowReader; 5 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents._SelectIterator; 6 import com.daffodilwoods.daffodildb.server.datadictionarysystem._ColumnCharacteristics; 7 import com.daffodilwoods.database.resource.DException; 8 import com.daffodilwoods.rmi.interfaces.*; 9 import java.rmi.RemoteException ; 10 import com.daffodilwoods.rmi.server.*; 11 import com.daffodilwoods.daffodildb.client.*; 12 import com.daffodilwoods.daffodildb.server.sql99.common.ExecutionPlanForBrowser; 13 14 public class RmiSelectIterator implements _SelectIterator { 15 16 _RmiSelectIterator selectIterator_Interface; 17 _ColumnCharacteristics cc; 18 _RowReader rowReader; 19 boolean beforeFirst; 20 boolean afterLast; 21 22 public RmiSelectIterator(_RmiSelectIterator selectIterator_Interface0,_ColumnCharacteristics cc0,_RowReader rowReader0) { 23 selectIterator_Interface = selectIterator_Interface0; 24 cc = cc0; 25 rowReader = rowReader0; 26 } 27 28 public _ColumnCharacteristics getColumnCharacteristics() throws DException { 29 try { 30 if(cc == null) 31 cc = selectIterator_Interface.getColumnCharacteristics(); 32 return cc; 33 }catch(RemoteException re) { 34 throw new RuntimeException (re.getMessage()); 35 } 36 } 37 public _RowReader getRowReader() throws DException { 38 try { 39 if(rowReader == null) 40 rowReader = selectIterator_Interface.getRowReader(); 41 return rowReader; 42 }catch(RemoteException re) { 43 throw new RuntimeException (re.getMessage()); 44 } 45 } 46 47 public void setKeyCount(Object [][] parm1) throws DException { 48 throw new java.lang.UnsupportedOperationException ("Method setKeyCount() not yet implemented."); 49 } 50 51 52 public void beforeFirst() throws DException { 53 beforeFirst = true; 54 } 55 public Object [] fetchForward(int rowCount) throws DException { 56 try { 57 SelectedRows rows = (SelectedRows) selectIterator_Interface.fetch(rowCount,true,beforeFirst); 58 beforeFirst = false; 59 afterLast = false; 60 return rows.getRows(); 61 }catch(RemoteException re) { 62 throw new RuntimeException (re.getMessage()); 63 } 64 } 65 public void afterLast() throws DException { 66 afterLast = true; 67 } 68 public Object [] fetchBackward(int rowCount) throws DException { 69 try { 70 SelectedRows rows = (SelectedRows) selectIterator_Interface.fetch(rowCount,false,afterLast); 71 beforeFirst = false; 72 afterLast = false; 73 return rows.getRows(); 74 }catch(RemoteException re) { 75 throw new RuntimeException (re.getMessage()); 76 } 77 } 78 public void moveToRow(Object key) throws DException { 79 try { 80 selectIterator_Interface.move(key,false); 81 }catch(RemoteException re) { 82 throw new RuntimeException (re.getMessage()); 83 } 84 } 85 public int move(int rowCount) throws DException { 86 try { 87 return selectIterator_Interface.move(new Integer (rowCount),true); 88 }catch(RemoteException re) { 89 throw new RuntimeException (re.getMessage()); 90 } 91 } 92 93 public _SelectColumnCharacteristics getSelectColumnCharacteristics() throws DException { 94 try { 95 if(cc == null) 96 cc = selectIterator_Interface.getColumnCharacteristics(); 97 return (_SelectColumnCharacteristics)cc; 98 }catch(RemoteException re) { 99 throw new RuntimeException (re.getMessage()); 100 } 101 } 102 103 public int getRowCount() throws DException { 104 try { 105 return selectIterator_Interface.getRowCount(); 106 }catch(RemoteException re) { 107 throw new RuntimeException (re.getMessage()); 108 } 109 } 110 public Object insert(int[] columnIndexes, Object [] columnValues) throws DException { 111 try { 112 SelectedRows selRows = (SelectedRows)selectIterator_Interface.insert(columnIndexes,columnValues); 113 Object [] rows = selRows.getRows(); 114 return rows[0]; 115 }catch(RemoteException re) { 116 throw new RuntimeException (re.getMessage()); 117 } 118 } 119 public Object update(Object key, int[] columnIndexes, Object [] values, Object row) throws DException { 120 try { 121 SelectedRows selRows = (SelectedRows)selectIterator_Interface.update(key,columnIndexes,values,row); 122 Object [] rows = selRows.getRows(); 123 return rows[0]; 124 }catch(RemoteException re) { 125 throw new RuntimeException (re.getMessage()); 126 } 127 128 } 129 public void delete(Object key) throws DException { 130 try { 131 selectIterator_Interface.delete(key); 132 }catch(RemoteException re) { 133 throw new RuntimeException (re.getMessage()); 134 } 135 } 136 137 public Object moveToInsertRow() throws DException { 138 try { 139 SelectedRows selRows = (SelectedRows)selectIterator_Interface.moveToInsertRow(); 140 Object [] rows = selRows.getRows(); 141 return rows[0]; 142 }catch(RemoteException re) { 143 throw new RuntimeException (re.getMessage()); 144 } 145 } 146 147 public _ExecutionPlan getExecutionPlan() throws DException{ 148 throw new java.lang.UnsupportedOperationException ("Method getExecutionPlan() not yet implemented."); 149 } 150 151 public _QueryPlan getQueryPlan() throws DException{ 152 throw new java.lang.UnsupportedOperationException ("Method getQueryPlan() not yet implemented."); 153 } 154 155 public Object getSelectColumnValues() throws DException{ 156 throw new UnsupportedOperationException (); 157 } 158 159 public void flushInsertedRecord() throws DException { 160 try{ 161 selectIterator_Interface.flushInsertedRecord(); 162 }catch(RemoteException re) { 163 throw new RuntimeException (re.getMessage()); 164 } 165 } 166 167 public ExecutionPlanForBrowser getExecutionPlanForBrowser() throws DException { 168 try{ 169 return selectIterator_Interface.getExecutionPlanForBrowser(); 170 }catch(RemoteException re) { 171 throw new RuntimeException (re.getMessage()); 172 } 173 } 174 public boolean isUpdatable() throws DException { 175 try { 176 return selectIterator_Interface.isUpdatable(); 177 }catch(RemoteException re) { 178 throw new RuntimeException (re.getMessage()); 179 } 180 } 181 public Object getObject() throws DException{ 182 throw new java.lang.UnsupportedOperationException ("Method getObject() not yet implemented."); 183 } 184 public int[] getDataTypes() throws DException { 185 throw new java.lang.UnsupportedOperationException ("Method getDataTypes() not yet implemented."); 186 } 187 } 188 | Popular Tags |