4140 * this method |
4144 * this method |
4141 * @since 1.7 |
4145 * @since 1.7 |
4142 */ |
4146 */ |
4143 public <T> T getObject(String columnLabel, Class<T> type) throws SQLException; |
4147 public <T> T getObject(String columnLabel, Class<T> type) throws SQLException; |
4144 |
4148 |
|
4149 //------------------------- JDBC 4.2 ----------------------------------- |
|
4150 |
|
4151 /** |
|
4152 * Updates the designated column with an {@code Object} value. |
|
4153 * |
|
4154 * The updater methods are used to update column values in the |
|
4155 * current row or the insert row. The updater methods do not |
|
4156 * update the underlying database; instead the {@code updateRow} or |
|
4157 * {@code insertRow} methods are called to update the database. |
|
4158 *<p> |
|
4159 * If the second argument is an {@code InputStream} then the stream must contain |
|
4160 * the number of bytes specified by scaleOrLength. If the second argument is a |
|
4161 * {@code Reader} then the reader must contain the number of characters specified |
|
4162 * by scaleOrLength. If these conditions are not true the driver will generate a |
|
4163 * {@code SQLException} when the statement is executed. |
|
4164 *<p> |
|
4165 * The default implementation will throw {@code SQLFeatureNotSupportedException} |
|
4166 * |
|
4167 * @param columnIndex the first column is 1, the second is 2, ... |
|
4168 * @param x the new column value |
|
4169 * @param targetSqlType the SQL type to be sent to the database |
|
4170 * @param scaleOrLength for an object of {@code java.math.BigDecimal} , |
|
4171 * this is the number of digits after the decimal point. For |
|
4172 * Java Object types {@code InputStream} and {@code Reader}, |
|
4173 * this is the length |
|
4174 * of the data in the stream or reader. For all other types, |
|
4175 * this value will be ignored. |
|
4176 * @exception SQLException if the columnIndex is not valid; |
|
4177 * if a database access error occurs; |
|
4178 * the result set concurrency is {@code CONCUR_READ_ONLY} |
|
4179 * or this method is called on a closed result set |
|
4180 * @exception SQLFeatureNotSupportedException if the JDBC driver does not |
|
4181 * support this method; if the JDBC driver does not support this data type |
|
4182 * @see JDBCType |
|
4183 * @see SQLType |
|
4184 * @since 1.8 |
|
4185 */ |
|
4186 default void updateObject(int columnIndex, Object x, |
|
4187 SQLType targetSqlType, int scaleOrLength) throws SQLException { |
|
4188 throw new SQLFeatureNotSupportedException("updateObject not implemented"); |
|
4189 } |
|
4190 |
|
4191 /** |
|
4192 * Updates the designated column with an {@code Object} value. |
|
4193 * |
|
4194 * The updater methods are used to update column values in the |
|
4195 * current row or the insert row. The updater methods do not |
|
4196 * update the underlying database; instead the {@code updateRow} or |
|
4197 * {@code insertRow} methods are called to update the database. |
|
4198 *<p> |
|
4199 * If the second argument is an {@code InputStream} then the stream must |
|
4200 * contain number of bytes specified by scaleOrLength. If the second |
|
4201 * argument is a {@code Reader} then the reader must contain the number |
|
4202 * of characters specified by scaleOrLength. If these conditions are not |
|
4203 * true the driver will generate a |
|
4204 * {@code SQLException} when the statement is executed. |
|
4205 *<p> |
|
4206 * The default implementation will throw {@code SQLFeatureNotSupportedException} |
|
4207 * |
|
4208 * @param columnLabel the label for the column specified with the SQL AS |
|
4209 * clause. If the SQL AS clause was not specified, then the label is |
|
4210 * the name of the column |
|
4211 * @param targetSqlType the SQL type to be sent to the database |
|
4212 * @param scaleOrLength for an object of {@code java.math.BigDecimal} , |
|
4213 * this is the number of digits after the decimal point. For |
|
4214 * Java Object types {@code InputStream} and {@code Reader}, |
|
4215 * this is the length |
|
4216 * of the data in the stream or reader. For all other types, |
|
4217 * this value will be ignored. |
|
4218 * @exception SQLException if the columnLabel is not valid; |
|
4219 * if a database access error occurs; |
|
4220 * the result set concurrency is {@code CONCUR_READ_ONLY} |
|
4221 * or this method is called on a closed result set |
|
4222 * @exception SQLFeatureNotSupportedException if the JDBC driver does not |
|
4223 * support this method; if the JDBC driver does not support this data type |
|
4224 * @see JDBCType |
|
4225 * @see SQLType |
|
4226 * @since 1.8 |
|
4227 */ |
|
4228 default void updateObject(String columnLabel, Object x, |
|
4229 SQLType targetSqlType, int scaleOrLength) throws SQLException { |
|
4230 throw new SQLFeatureNotSupportedException("updateObject not implemented"); |
|
4231 } |
|
4232 |
|
4233 /** |
|
4234 * Updates the designated column with an {@code Object} value. |
|
4235 * |
|
4236 * The updater methods are used to update column values in the |
|
4237 * current row or the insert row. The updater methods do not |
|
4238 * update the underlying database; instead the {@code updateRow} or |
|
4239 * {@code insertRow} methods are called to update the database. |
|
4240 *<p> |
|
4241 * The default implementation will throw {@code SQLFeatureNotSupportedException} |
|
4242 * |
|
4243 * @param columnIndex the first column is 1, the second is 2, ... |
|
4244 * @param x the new column value |
|
4245 * @param targetSqlType the SQL type to be sent to the database |
|
4246 * @exception SQLException if the columnIndex is not valid; |
|
4247 * if a database access error occurs; |
|
4248 * the result set concurrency is {@code CONCUR_READ_ONLY} |
|
4249 * or this method is called on a closed result set |
|
4250 * @exception SQLFeatureNotSupportedException if the JDBC driver does not |
|
4251 * support this method; if the JDBC driver does not support this data type |
|
4252 * @see JDBCType |
|
4253 * @see SQLType |
|
4254 * @since 1.8 |
|
4255 */ |
|
4256 default void updateObject(int columnIndex, Object x, SQLType targetSqlType) |
|
4257 throws SQLException { |
|
4258 throw new SQLFeatureNotSupportedException("updateObject not implemented"); |
|
4259 } |
|
4260 |
|
4261 /** |
|
4262 * Updates the designated column with an {@code Object} value. |
|
4263 * |
|
4264 * The updater methods are used to update column values in the |
|
4265 * current row or the insert row. The updater methods do not |
|
4266 * update the underlying database; instead the {@code updateRow} or |
|
4267 * {@code insertRow} methods are called to update the database. |
|
4268 *<p> |
|
4269 * The default implementation will throw {@code SQLFeatureNotSupportedException} |
|
4270 * |
|
4271 * @param columnLabel the label for the column specified with the SQL AS |
|
4272 * clause. If the SQL AS clause was not specified, then the label is |
|
4273 * the name of the column |
|
4274 * @param x the new column value |
|
4275 * @param targetSqlType the SQL type to be sent to the database |
|
4276 * @exception SQLException if the columnLabel is not valid; |
|
4277 * if a database access error occurs; |
|
4278 * the result set concurrency is {@code CONCUR_READ_ONLY} |
|
4279 * or this method is called on a closed result set |
|
4280 * @exception SQLFeatureNotSupportedException if the JDBC driver does not |
|
4281 * support this method; if the JDBC driver does not support this data type |
|
4282 * @see JDBCType |
|
4283 * @see SQLType |
|
4284 * @since 1.8 |
|
4285 */ |
|
4286 default void updateObject(String columnLabel, Object x, |
|
4287 SQLType targetSqlType) throws SQLException { |
|
4288 throw new SQLFeatureNotSupportedException("updateObject not implemented"); |
|
4289 } |
4145 } |
4290 } |