| 1 package com.daffodilwoods.daffodildb.client; 2 3 import java.sql.SQLException ; 4 import com.daffodilwoods.database.resource.DException; 5 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata._SelectColumnCharacteristics; 6 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata._RowReader; 7 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents._SelectIterator; 8 import com.daffodilwoods.daffodildb.server.sql99.common.ExecutionPlanForBrowser; 9 10 public class TempRecordSetBuffer implements _RecordSetBuffer { 11 _RecordSetBufferIterator recordSetBufferIterator; 12 Object [][] data; 13 int len; 14 _SelectColumnCharacteristics scc; 15 public TempRecordSetBuffer (Object [][] data0,_SelectColumnCharacteristics scc0){ 16 data = data0; 17 len = data == null ? 0 : data.length; 18 scc = scc0;; 19 } 20 public _RecordSetBufferIterator getIterator() throws SQLException { 21 if (recordSetBufferIterator == null) { 22 recordSetBufferIterator = new RecordSetBufferIterator(); 23 recordSetBufferIterator.setRecordSetBuffer(this); 24 } 25 return recordSetBufferIterator; 26 } 27 28 public String getTable() throws SQLException { 29 return ""; 30 } 31 public Object getTopKey() throws SQLException { 32 if(data == null) 33 return null; 34 return new Integer (0); 35 } 36 public Object getBottomKey() throws SQLException { 37 if(data == null) 38 return null; 39 return new Integer (len -1); 40 } 41 public Object getNextKey(Object parm1) throws SQLException { 42 if(parm1 == null) 43 throw new SQLException ("DSEClient key can n't be null"); 44 int index = parm1.hashCode(); 45 return index >= len -1 ? null : new Integer (index+1); 46 } 47 public Object getPreviousKey(Object parm1) throws SQLException { 48 if(parm1 == null) 49 throw new SQLException ("DSEClient key can not be null"); 50 int index = parm1.hashCode(); 51 return index <= 0 ? null : new Integer (index-1); 52 } 53 public void loadRecordForKey(_Record record, Object key) throws SQLException { 54 if (key == null) 55 throw new SQLException (new DException("DSE550", null).getMessage()); 56 int index = key.hashCode(); 57 if (index < 0 && index >= len) 58 throw new SQLException (new DException("DSE552", new Object [] {key}). 59 getMessage()); 60 Object row = data[index]; 61 JDBCRecord drecord = (JDBCRecord) record; 62 drecord.setBuffer(this); 63 drecord.setValues(row); 64 drecord.setKey(key); 65 } 66 67 public _SelectColumnCharacteristics getColumnCharacteristics() { 68 return scc; 69 } 70 71 public _RowReader getRowReader() throws SQLException { 72 return (_RowReader)scc; 73 } 74 public int getRowCount() throws SQLException { 75 return len; 76 } 77 public boolean isBottom(Object parm1) throws SQLException { 78 if(parm1 == null) 79 throw new SQLException ("DSEClient key can not be null"); 80 int index = parm1.hashCode(); 81 return index == len-1; 82 } 83 public boolean isTop(Object parm1) throws SQLException { 84 if(parm1 == null) 85 throw new SQLException ("DSEClient key can not be null"); 86 int index = parm1.hashCode(); 87 return index == 0; 88 } 89 90 public _Record getRecordInstance() { 91 return new JDBCRecord(false); 92 } 93 94 95 96 public void setSelectIterator(_SelectIterator parm1) throws DException { 97 throw new java.lang.UnsupportedOperationException ("Method setSelectIterator() not yet implemented."); 98 } 99 public void setUpdateMode(boolean parm1) { 100 throw new java.lang.UnsupportedOperationException ("Method setUpdateMode() not yet implemented."); 101 } 102 103 public _ExecutionPlan getExecutionPlan() throws DException { 104 throw new java.lang.UnsupportedOperationException ("Method getExecutionPlan() not yet implemented."); 105 } 106 public ExecutionPlanForBrowser getExecutionPlanForBrowser() throws DException { 107 throw new java.lang.UnsupportedOperationException ("Method getExecutionPlanForBrowser() not yet implemented."); 108 } 109 public _QueryPlan getQueryPlan() throws DException { 110 throw new java.lang.UnsupportedOperationException ("Method getQueryPlan() not yet implemented."); 111 } 112 public _Record getDummyRecord() throws SQLException { 113 throw new java.lang.UnsupportedOperationException ("Method getDummyRecord() not yet implemented."); 114 } 115 public void flushRecords(Object parm1, boolean parm2) throws DException { 116 throw new java.lang.UnsupportedOperationException ("Method flushRecords() not yet implemented."); 117 } 118 public Object seek(String parm1) throws SQLException { 119 throw new java.lang.UnsupportedOperationException ("Method seek() not yet implemented."); 120 } 121 public void setAutoFlush(boolean parm1) throws DException { 122 throw new java.lang.UnsupportedOperationException ("Method setAutoFlush() not yet implemented."); 123 } 124 public void setBufferSize(int parm1) throws DException { 125 throw new java.lang.UnsupportedOperationException ("Method setBufferSize() not yet implemented."); 126 } 127 128 public Object convertIntoParameter() throws SQLException , DException { 129 throw new java.lang.UnsupportedOperationException ("Method convertIntoParameter() not yet implemented."); 130 } 131 132 public void setFetchDirection(int parm1) { 133 throw new java.lang.UnsupportedOperationException ("Method setFetchDirection() not yet implemented."); 134 } 135 public void setMaxRows(int parm1) { 136 throw new java.lang.UnsupportedOperationException ("Method setMaxRows() not yet implemented."); 137 } 138 public void setMaxFieldSize(int parm1) { 139 throw new java.lang.UnsupportedOperationException ("Method setMaxFieldSize() not yet implemented."); 140 } 141 public String getQuery() { 142 throw new java.lang.UnsupportedOperationException ("Method getQuery() not yet implemented."); 143 } 144 public void loadRecordForIdentity(_Record parm1, Object parm2) throws SQLException { 145 throw new java.lang.UnsupportedOperationException ("Method loadRecordForIdentity() not yet implemented."); 146 } 147 public Object getKeyForIdentity(Object parm1) throws DException { 148 throw new java.lang.UnsupportedOperationException ("Method getKeyForIdentity() not yet implemented."); 149 } 150 public Object getIdentityForKey(Object parm1) throws DException { 151 throw new java.lang.UnsupportedOperationException ("Method getIdentityForKey() not yet implemented."); 152 } 153 public Object [] getParameters() { 154 throw new java.lang.UnsupportedOperationException ("Method getParameters() not yet implemented."); 155 } 156 public Object locateNearestKey(Object parm1) throws SQLException { 157 throw new java.lang.UnsupportedOperationException ("Method locateNearestKey() not yet implemented."); 158 } 159 public void addDataOperationListener(DataOperationListener parm1) throws DException { 160 throw new java.lang.UnsupportedOperationException ("Method addDataOperationListener() not yet implemented."); 161 } 162 public void removeDataOperationListener(DataOperationListener parm1) throws DException { 163 throw new java.lang.UnsupportedOperationException ("Method removeDataOperationListener() not yet implemented."); 164 } 165 public int getDistanceBetweenKeys(Object parm1, Object parm2) throws SQLException { 166 throw new java.lang.UnsupportedOperationException ("Method getDistanceBetweenKeys() not yet implemented."); 167 } 168 public Object getKeyAtDistance(Object parm1, int parm2) throws SQLException { 169 throw new java.lang.UnsupportedOperationException ("Method getKeyAtDistance() not yet implemented."); 170 } 171 public _Record getInsertedRecord() throws DException { 172 throw new java.lang.UnsupportedOperationException ("Method getInsertedRecord() not yet implemented."); 173 } 174 public Object insertRow() throws DException { 175 throw new java.lang.UnsupportedOperationException ("Method insertRow() not yet implemented."); 176 } 177 public void updateRow(_Record parm1) throws DException, SQLException { 178 throw new java.lang.UnsupportedOperationException ("Method updateRow() not yet implemented."); 179 } 180 public Object deleteRow(_Record parm1) throws DException { 181 throw new java.lang.UnsupportedOperationException ("Method deleteRow() not yet implemented."); 182 } 183 184 } 185 | Popular Tags |