|
| 1 | +packageorg.postgresql.jdbc2; |
| 2 | + |
| 3 | +// IMPORTANT NOTE: This is the begining of supporting updatable ResultSets. |
| 4 | +// It is not a working solution (yet)! |
| 5 | +// |
| 6 | +// You will notice here we really do throw org.postgresql.Driver.notImplemented() |
| 7 | +// This is because here we should be updateable, so any unimplemented methods |
| 8 | +// must say so. |
| 9 | +// |
| 10 | +// Also you'll notice that the String columnName based calls are not present. |
| 11 | +// They are not required as they are in the super class. |
| 12 | +// |
| 13 | + |
| 14 | +importjava.lang.*; |
| 15 | +importjava.io.*; |
| 16 | +importjava.math.*; |
| 17 | +importjava.text.*; |
| 18 | +importjava.util.*; |
| 19 | +importjava.sql.*; |
| 20 | +importorg.postgresql.Field; |
| 21 | +importorg.postgresql.largeobject.*; |
| 22 | +importorg.postgresql.util.*; |
| 23 | + |
| 24 | +/** |
| 25 | + * @see ResultSet |
| 26 | + * @see ResultSetMetaData |
| 27 | + * @see java.sql.ResultSet |
| 28 | + */ |
| 29 | +publicclassUpdateableResultSetextendsorg.postgresql.jdbc2.ResultSet |
| 30 | +{ |
| 31 | + |
| 32 | +/** |
| 33 | + * Create a new ResultSet - Note that we create ResultSets to |
| 34 | + * represent the results of everything. |
| 35 | + * |
| 36 | + * @param fields an array of Field objects (basically, the |
| 37 | + *ResultSet MetaData) |
| 38 | + * @param tuples Vector of the actual data |
| 39 | + * @param status the status string returned from the back end |
| 40 | + * @param updateCount the number of rows affected by the operation |
| 41 | + * @param cursor the positioned update/delete cursor name |
| 42 | + */ |
| 43 | +publicUpdateableResultSet(Connectionconn,Field[]fields,Vectortuples,Stringstatus,intupdateCount,intinsertOID) |
| 44 | + { |
| 45 | +super(conn,fields,tuples,status,updateCount,insertOID); |
| 46 | + } |
| 47 | + |
| 48 | +/** |
| 49 | + * Create a new ResultSet - Note that we create ResultSets to |
| 50 | + * represent the results of everything. |
| 51 | + * |
| 52 | + * @param fields an array of Field objects (basically, the |
| 53 | + *ResultSet MetaData) |
| 54 | + * @param tuples Vector of the actual data |
| 55 | + * @param status the status string returned from the back end |
| 56 | + * @param updateCount the number of rows affected by the operation |
| 57 | + * @param cursor the positioned update/delete cursor name |
| 58 | + */ |
| 59 | +publicUpdateableResultSet(Connectionconn,Field[]fields,Vectortuples,Stringstatus,intupdateCount) |
| 60 | + { |
| 61 | +super(conn,fields,tuples,status,updateCount,0); |
| 62 | + } |
| 63 | + |
| 64 | +publicvoidcancelRowUpdates()throwsSQLException |
| 65 | + { |
| 66 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 67 | +throworg.postgresql.Driver.notImplemented(); |
| 68 | + } |
| 69 | + |
| 70 | +publicvoiddeleteRow()throwsSQLException |
| 71 | + { |
| 72 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 73 | +throworg.postgresql.Driver.notImplemented(); |
| 74 | + } |
| 75 | + |
| 76 | +publicintgetConcurrency()throwsSQLException |
| 77 | + { |
| 78 | +// New in 7.1 - The updateable ResultSet class will now return |
| 79 | +// CONCUR_UPDATEABLE. |
| 80 | +returnCONCUR_UPDATABLE; |
| 81 | + } |
| 82 | + |
| 83 | +publicvoidinsertRow()throwsSQLException |
| 84 | + { |
| 85 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 86 | +throworg.postgresql.Driver.notImplemented(); |
| 87 | + } |
| 88 | + |
| 89 | +publicvoidmoveToCurrentRow()throwsSQLException |
| 90 | + { |
| 91 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 92 | +throworg.postgresql.Driver.notImplemented(); |
| 93 | + } |
| 94 | + |
| 95 | +publicvoidmoveToInsertRow()throwsSQLException |
| 96 | + { |
| 97 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 98 | +throworg.postgresql.Driver.notImplemented(); |
| 99 | + } |
| 100 | + |
| 101 | +publicbooleanrowDeleted()throwsSQLException |
| 102 | + { |
| 103 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 104 | +throworg.postgresql.Driver.notImplemented(); |
| 105 | +//return false; // javac complains about not returning a value! |
| 106 | + } |
| 107 | + |
| 108 | +publicbooleanrowInserted()throwsSQLException |
| 109 | + { |
| 110 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 111 | +throworg.postgresql.Driver.notImplemented(); |
| 112 | +//return false; // javac complains about not returning a value! |
| 113 | + } |
| 114 | + |
| 115 | +publicbooleanrowUpdated()throwsSQLException |
| 116 | + { |
| 117 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 118 | +throworg.postgresql.Driver.notImplemented(); |
| 119 | +//return false; // javac complains about not returning a value! |
| 120 | + } |
| 121 | + |
| 122 | +publicvoidupdateAsciiStream(intcolumnIndex, |
| 123 | +java.io.InputStreamx, |
| 124 | +intlength |
| 125 | + )throwsSQLException |
| 126 | + { |
| 127 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 128 | +throworg.postgresql.Driver.notImplemented(); |
| 129 | + } |
| 130 | + |
| 131 | +publicvoidupdateBigDecimal(intcolumnIndex, |
| 132 | +java.math.BigDecimalx |
| 133 | + )throwsSQLException |
| 134 | + { |
| 135 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 136 | +throworg.postgresql.Driver.notImplemented(); |
| 137 | + } |
| 138 | + |
| 139 | +publicvoidupdateBinaryStream(intcolumnIndex, |
| 140 | +java.io.InputStreamx, |
| 141 | +intlength |
| 142 | + )throwsSQLException |
| 143 | + { |
| 144 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 145 | +throworg.postgresql.Driver.notImplemented(); |
| 146 | + } |
| 147 | + |
| 148 | +publicvoidupdateBoolean(intcolumnIndex,booleanx)throwsSQLException |
| 149 | + { |
| 150 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 151 | +throworg.postgresql.Driver.notImplemented(); |
| 152 | + } |
| 153 | + |
| 154 | +publicvoidupdateByte(intcolumnIndex,bytex)throwsSQLException |
| 155 | + { |
| 156 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 157 | +throworg.postgresql.Driver.notImplemented(); |
| 158 | + } |
| 159 | + |
| 160 | +publicvoidupdateBytes(intcolumnIndex,byte[]x)throwsSQLException |
| 161 | + { |
| 162 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 163 | +throworg.postgresql.Driver.notImplemented(); |
| 164 | + } |
| 165 | + |
| 166 | +publicvoidupdateCharacterStream(intcolumnIndex, |
| 167 | +java.io.Readerx, |
| 168 | +intlength |
| 169 | + )throwsSQLException |
| 170 | + { |
| 171 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 172 | +throworg.postgresql.Driver.notImplemented(); |
| 173 | + } |
| 174 | + |
| 175 | +publicvoidupdateDate(intcolumnIndex,java.sql.Datex)throwsSQLException |
| 176 | + { |
| 177 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 178 | +throworg.postgresql.Driver.notImplemented(); |
| 179 | + } |
| 180 | + |
| 181 | +publicvoidupdateDouble(intcolumnIndex,doublex)throwsSQLException |
| 182 | + { |
| 183 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 184 | +throworg.postgresql.Driver.notImplemented(); |
| 185 | + } |
| 186 | + |
| 187 | +publicvoidupdateFloat(intcolumnIndex,floatx)throwsSQLException |
| 188 | + { |
| 189 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 190 | +throworg.postgresql.Driver.notImplemented(); |
| 191 | + } |
| 192 | + |
| 193 | +publicvoidupdateInt(intcolumnIndex,intx)throwsSQLException |
| 194 | + { |
| 195 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 196 | +throworg.postgresql.Driver.notImplemented(); |
| 197 | + } |
| 198 | + |
| 199 | +publicvoidupdateLong(intcolumnIndex,longx)throwsSQLException |
| 200 | + { |
| 201 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 202 | +throworg.postgresql.Driver.notImplemented(); |
| 203 | + } |
| 204 | + |
| 205 | +publicvoidupdateNull(intcolumnIndex)throwsSQLException |
| 206 | + { |
| 207 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 208 | +throworg.postgresql.Driver.notImplemented(); |
| 209 | + } |
| 210 | + |
| 211 | +publicvoidupdateObject(intcolumnIndex,Objectx)throwsSQLException |
| 212 | + { |
| 213 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 214 | +throworg.postgresql.Driver.notImplemented(); |
| 215 | + } |
| 216 | + |
| 217 | +publicvoidupdateObject(intcolumnIndex,Objectx,intscale)throwsSQLException |
| 218 | + { |
| 219 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 220 | +throworg.postgresql.Driver.notImplemented(); |
| 221 | + } |
| 222 | + |
| 223 | +publicvoidupdateRow()throwsSQLException |
| 224 | + { |
| 225 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 226 | +throworg.postgresql.Driver.notImplemented(); |
| 227 | + } |
| 228 | + |
| 229 | +publicvoidupdateShort(intcolumnIndex,shortx)throwsSQLException |
| 230 | + { |
| 231 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 232 | +throworg.postgresql.Driver.notImplemented(); |
| 233 | + } |
| 234 | + |
| 235 | +publicvoidupdateString(intcolumnIndex,Stringx)throwsSQLException |
| 236 | + { |
| 237 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 238 | +throworg.postgresql.Driver.notImplemented(); |
| 239 | + } |
| 240 | + |
| 241 | +publicvoidupdateTime(intcolumnIndex,Timex)throwsSQLException |
| 242 | + { |
| 243 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 244 | +throworg.postgresql.Driver.notImplemented(); |
| 245 | + } |
| 246 | + |
| 247 | +publicvoidupdateTimestamp(intcolumnIndex,Timestampx)throwsSQLException |
| 248 | + { |
| 249 | +// only sub-classes implement CONCUR_UPDATEABLE |
| 250 | +throworg.postgresql.Driver.notImplemented(); |
| 251 | + } |
| 252 | + |
| 253 | +} |
| 254 | + |