1 21 22 package org.apache.derby.impl.jdbc; 23 24 import org.apache.derby.iapi.reference.JDBC20Translation; 25 import org.apache.derby.iapi.reference.SQLState; 26 27 import org.apache.derby.iapi.sql.ResultSet; 28 29 import org.apache.derby.iapi.sql.execute.ExecCursorTableReference; 30 31 import org.apache.derby.iapi.error.StandardException; 32 import org.apache.derby.impl.jdbc.Util; 33 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 34 import org.apache.derby.iapi.sql.conn.StatementContext; 35 36 import org.apache.derby.iapi.types.DataValueDescriptor; 37 38 import java.sql.Statement ; 39 import java.sql.SQLException ; 40 import java.sql.Types ; 41 42 43 import java.sql.Array ; 44 import java.sql.Blob ; 45 import java.sql.Clob ; 46 import java.sql.Ref ; 47 48 import java.math.BigDecimal ; 49 import java.net.URL ; 50 51 63 64 public class EmbedResultSet20 65 extends org.apache.derby.impl.jdbc.EmbedResultSet { 66 67 73 77 public EmbedResultSet20(org.apache.derby.impl.jdbc.EmbedConnection conn, 78 ResultSet resultsToWrap, 79 boolean forMetaData, 80 org.apache.derby.impl.jdbc.EmbedStatement stmt, 81 boolean isAtomic) 82 throws SQLException { 83 super(conn, resultsToWrap, forMetaData, stmt, isAtomic); 84 } 85 86 87 90 98 public final BigDecimal getBigDecimal(int columnIndex, int scale) 99 throws SQLException { 100 101 BigDecimal ret = getBigDecimal(columnIndex); 102 if (ret != null) { 103 return ret.setScale(scale, BigDecimal.ROUND_HALF_DOWN); 104 } 105 return null; 106 } 107 108 public final BigDecimal getBigDecimal(int columnIndex) 109 throws SQLException { 110 checkIfClosed("getBigDecimal"); 111 try { 112 113 DataValueDescriptor dvd = getColumn(columnIndex); 114 115 if (wasNull = dvd.isNull()) 116 return null; 117 118 return org.apache.derby.iapi.types.SQLDecimal.getBigDecimal(dvd); 119 120 } catch (StandardException t) { 121 throw noStateChangeException(t); 122 } 123 } 124 125 133 public final BigDecimal getBigDecimal(String columnName, int scale) 134 throws SQLException { 135 checkIfClosed("getBigDecimal"); 136 return (getBigDecimal(findColumnName(columnName), scale)); 137 } 138 139 140 146 public final java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { 147 throw Util.notImplemented("getUnicodeStream"); 148 } 149 153 public final java.io.InputStream getUnicodeStream(String columnName) throws SQLException { 154 throw Util.notImplemented("getUnicodeStream"); 155 } 156 157 165 public final BigDecimal getBigDecimal(String columnName) throws SQLException { 166 checkIfClosed("getBigDecimal"); 167 return getBigDecimal(findColumnName(columnName)); 168 } 169 170 public void updateBigDecimal(int columnIndex, BigDecimal x) 171 throws SQLException { 172 try { 173 getDVDforColumnToBeUpdated(columnIndex, "updateBigDecimal").setBigDecimal(x); 174 } catch (StandardException t) { 175 throw noStateChangeException(t); 176 } 177 } 178 179 196 public void updateObject(int columnIndex, Object x) throws SQLException { 197 checksBeforeUpdateOrDelete("updateObject", columnIndex); 201 int colType = getColumnType(columnIndex); 202 203 if (x instanceof BigDecimal ) { 204 updateBigDecimal(columnIndex, (BigDecimal ) x); 205 return; 206 } 207 super.updateObject(columnIndex, x); 208 } 209 210 224 public void updateBigDecimal(String columnName, BigDecimal x) 225 throws SQLException { 226 checkIfClosed("updateBigDecimal"); 227 updateBigDecimal(findColumnName(columnName), x); 228 } 229 230 242 public Object getObject(int columnIndex, java.util.Map map) throws SQLException { 243 checkIfClosed("getObject"); 244 if( map == null) 245 throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,map,"map", 246 "java.sql.ResultSet.getObject"); 247 if(!(map.isEmpty())) 248 throw Util.notImplemented(); 249 return getObject(columnIndex); 251 } 252 253 262 public Ref getRef(int i) throws SQLException { 263 throw Util.notImplemented(); 264 } 265 266 275 public Array getArray(int i) throws SQLException { 276 throw Util.notImplemented(); 277 } 278 279 291 public Object getObject(String colName, java.util.Map map) 292 throws SQLException { 293 checkIfClosed("getObject"); 294 return getObject(findColumn(colName),map); 295 } 296 297 306 public Ref getRef(String colName) throws SQLException { 307 throw Util.notImplemented(); 308 } 309 310 311 312 313 322 public Array getArray(String colName) throws SQLException { 323 throw Util.notImplemented(); 324 } 325 326 327 334 335 341 342 343 355 public void updateRef(int columnIndex, Ref x) 356 throws SQLException 357 { 358 throw Util.notImplemented(); 359 } 360 361 373 public void updateRef(String columnName, Ref x) 374 throws SQLException 375 { 376 throw Util.notImplemented(); 377 } 378 379 391 public void updateArray(int columnIndex, Array x) 392 throws SQLException 393 { 394 throw Util.notImplemented(); 395 } 396 397 409 public void updateArray(String columnName, Array x) 410 throws SQLException 411 { 412 throw Util.notImplemented(); 413 } 414 415 416 417 418 } 419 | Popular Tags |