1 package net.sf.sapjcosupport.jdbc;
2
3 import java.sql.Connection;
4 import java.sql.ResultSet;
5 import java.sql.SQLException;
6 import java.sql.SQLWarning;
7
8 /**
9 * Created by IntelliJ IDEA.
10 * User: NDE1677
11 * Date: Jul 5, 2006
12 * Time: 12:40:14 PM
13 * To change this template use File | Settings | File Templates.
14 */
15 public class SapQLStatement implements java.sql.Statement {
16 private SapConnection connection;
17
18 public SapQLStatement(SapConnection connection) {
19 this.connection = connection;
20 }
21
22 /**
23 * Executes an SQL statement that returns a single <code>ResultSet</code> object.
24 *
25 * @param sql typically this is a static SQL <code>SELECT</code> statement
26 * @return a <code>ResultSet</code> object that contains the data produced by the
27 * given query; never <code>null</code>
28 * @throws java.sql.SQLException if a database access error occurs
29 */
30 public ResultSet executeQuery(String sql) throws SQLException {
31 return null;
32 }
33
34 /**
35 * Executes an SQL <code>INSERT</code>, <code>UPDATE</code> or
36 * <code>DELETE</code> statement. In addition,
37 * SQL statements that return nothing, such as SQL DDL statements,
38 * can be executed.
39 *
40 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
41 * <code>DELETE</code> statement or an SQL statement that returns nothing
42 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>
43 * or <code>DELETE</code> statements, or 0 for SQL statements that return nothing
44 * @throws java.sql.SQLException if a database access error occurs
45 */
46 public int executeUpdate(String sql) throws SQLException {
47 return 0;
48 }
49
50 /**
51 * Releases this <code>SapQLStatement</code> object's database
52 * and JDBC resources immediately instead of waiting for
53 * this to happen when it is automatically closed.
54 * It is generally good practice to release resources as soon as
55 * you are finished with them to avoid tying up database
56 * resources.
57 * <P><B>Note:</B> A <code>SapQLStatement</code> object is automatically closed when it is
58 * garbage collected. When a <code>SapQLStatement</code> object is closed, its current
59 * <code>ResultSet</code> object, if one exists, is also closed.
60 *
61 * @throws java.sql.SQLException if a database access error occurs
62 */
63 public void close() throws SQLException {
64
65 }
66
67 /**
68 * Returns the maximum number of bytes allowed
69 * for any column value.
70 * This limit is the maximum number of bytes that can be
71 * returned for any column value.
72 * The limit applies only to <code>BINARY</code>,
73 * <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, and <code>LONGVARCHAR</code>
74 * columns. If the limit is exceeded, the excess data is silently
75 * discarded.
76 *
77 * @return the current max column size limit; zero means unlimited
78 * @throws java.sql.SQLException if a database access error occurs
79 */
80 public int getMaxFieldSize() throws SQLException {
81 return 0;
82 }
83
84 /**
85 * Sets the limit for the maximum number of bytes in a column to
86 * the given number of bytes. This is the maximum number of bytes
87 * that can be returned for any column value. This limit applies
88 * only to <code>BINARY</code>, <code>VARBINARY</code>,
89 * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, and
90 * <code>LONGVARCHAR</code> fields. If the limit is exceeded, the excess data
91 * is silently discarded. For maximum portability, use values
92 * greater than 256.
93 *
94 * @param max the new max column size limit; zero means unlimited
95 * @throws java.sql.SQLException if a database access error occurs
96 */
97 public void setMaxFieldSize(int max) throws SQLException {
98
99 }
100
101 /**
102 * Retrieves the maximum number of rows that a
103 * <code>ResultSet</code> object can contain. If the limit is exceeded, the excess
104 * rows are silently dropped.
105 *
106 * @return the current max row limit; zero means unlimited
107 * @throws java.sql.SQLException if a database access error occurs
108 */
109 public int getMaxRows() throws SQLException {
110 return 0;
111 }
112
113 /**
114 * Sets the limit for the maximum number of rows that any
115 * <code>ResultSet</code> object can contain to the given number.
116 * If the limit is exceeded, the excess
117 * rows are silently dropped.
118 *
119 * @param max the new max rows limit; zero means unlimited
120 * @throws java.sql.SQLException if a database access error occurs
121 */
122 public void setMaxRows(int max) throws SQLException {
123
124 }
125
126 /**
127 * Sets escape processing on or off.
128 * If escape scanning is on (the default), the driver will do
129 * escape substitution before sending the SQL to the database.
130 * <p/>
131 * Note: Since prepared statements have usually been parsed prior
132 * to making this call, disabling escape processing for prepared
133 * statements will have no effect.
134 *
135 * @param enable <code>true</code> to enable; <code>false</code> to disable
136 * @throws java.sql.SQLException if a database access error occurs
137 */
138 public void setEscapeProcessing(boolean enable) throws SQLException {
139
140 }
141
142 /**
143 * Retrieves the number of seconds the driver will
144 * wait for a <code>SapQLStatement</code> object to execute. If the limit is exceeded, a
145 * <code>SQLException</code> is thrown.
146 *
147 * @return the current query timeout limit in seconds; zero means unlimited
148 * @throws java.sql.SQLException if a database access error occurs
149 */
150 public int getQueryTimeout() throws SQLException {
151 return 0;
152 }
153
154 /**
155 * Sets the number of seconds the driver will
156 * wait for a <code>SapQLStatement</code> object to execute to the given number of seconds.
157 * If the limit is exceeded, an <code>SQLException</code> is thrown.
158 *
159 * @param seconds the new query timeout limit in seconds; zero means
160 * unlimited
161 * @throws java.sql.SQLException if a database access error occurs
162 */
163 public void setQueryTimeout(int seconds) throws SQLException {
164
165 }
166
167 /**
168 * Cancels this <code>SapQLStatement</code> object if both the DBMS and
169 * driver support aborting an SQL statement.
170 * This method can be used by one thread to cancel a statement that
171 * is being executed by another thread.
172 *
173 * @throws java.sql.SQLException if a database access error occurs
174 */
175 public void cancel() throws SQLException {
176
177 }
178
179 /**
180 * Retrieves the first warning reported by calls on this <code>SapQLStatement</code> object.
181 * Subsequent <code>SapQLStatement</code> object warnings will be chained to this
182 * <code>SQLWarning</code> object.
183 * <p/>
184 * <p>The warning chain is automatically cleared each time
185 * a statement is (re)executed.
186 * <p/>
187 * <P><B>Note:</B> If you are processing a <code>ResultSet</code> object, any
188 * warnings associated with reads on that <code>ResultSet</code> object
189 * will be chained on it.
190 *
191 * @return the first <code>SQLWarning</code> object or <code>null</code>
192 * @throws java.sql.SQLException if a database access error occurs
193 */
194 public SQLWarning getWarnings() throws SQLException {
195 return null;
196 }
197
198 /**
199 * Clears all the warnings reported on this <code>SapQLStatement</code>
200 * object. After a call to this method,
201 * the method <code>getWarnings</code> will return
202 * <code>null</code> until a new warning is reported for this
203 * <code>SapQLStatement</code> object.
204 *
205 * @throws java.sql.SQLException if a database access error occurs
206 */
207 public void clearWarnings() throws SQLException {
208
209 }
210
211 /**
212 * Defines the SQL cursor name that will be used by
213 * subsequent <code>SapQLStatement</code> object <code>execute</code> methods.
214 * This name can then be
215 * used in SQL positioned update/delete statements to identify the
216 * current row in the <code>ResultSet</code> object generated by this statement. If
217 * the database doesn't support positioned update/delete, this
218 * method is a noop. To insure that a cursor has the proper isolation
219 * level to support updates, the cursor's <code>SELECT</code> statement should be
220 * of the form 'select for update ...'. If the 'for update' phrase is
221 * omitted, positioned updates may fail.
222 * <p/>
223 * <P><B>Note:</B> By definition, positioned update/delete
224 * execution must be done by a different <code>SapQLStatement</code> object than the one
225 * which generated the <code>ResultSet</code> object being used for positioning. Also,
226 * cursor names must be unique within a connection.
227 *
228 * @param name the new cursor name, which must be unique within
229 * a connection
230 * @throws java.sql.SQLException if a database access error occurs
231 */
232 public void setCursorName(String name) throws SQLException {
233
234 }
235
236 /**
237 * Executes an SQL statement that may return multiple results.
238 * Under some (uncommon) situations a single SQL statement may return
239 * multiple result sets and/or update counts. Normally you can ignore
240 * this unless you are (1) executing a stored procedure that you know may
241 * return multiple results or (2) you are dynamically executing an
242 * unknown SQL string. The methods <code>execute</code>,
243 * <code>getMoreResults</code>, <code>getResultSet</code>,
244 * and <code>getUpdateCount</code> let you navigate through multiple results.
245 * <p/>
246 * The <code>execute</code> method executes an SQL statement and indicates the
247 * form of the first result. You can then use the methods
248 * <code>getResultSet</code> or <code>getUpdateCount</code>
249 * to retrieve the result, and <code>getMoreResults</code> to
250 * move to any subsequent result(s).
251 *
252 * @param sql any SQL statement
253 * @return <code>true</code> if the next result is a <code>ResultSet</code> object;
254 * <code>false</code> if it is an update count or there are no more results
255 * @throws java.sql.SQLException if a database access error occurs
256 * @see #getResultSet
257 * @see #getUpdateCount
258 * @see #getMoreResults
259 */
260 public boolean execute(String sql) throws SQLException {
261 return false;
262 }
263
264 /**
265 * Returns the current result as a <code>ResultSet</code> object.
266 * This method should be called only once per result.
267 *
268 * @return the current result as a <code>ResultSet</code> object;
269 * <code>null</code> if the result is an update count or there are no more results
270 * @throws java.sql.SQLException if a database access error occurs
271 * @see #execute
272 */
273 public ResultSet getResultSet() throws SQLException {
274 return null;
275 }
276
277 /**
278 * Returns the current result as an update count;
279 * if the result is a <code>ResultSet</code> object or there are no more results, -1
280 * is returned. This method should be called only once per result.
281 *
282 * @return the current result as an update count; -1 if the current result is a
283 * <code>ResultSet</code> object or there are no more results
284 * @throws java.sql.SQLException if a database access error occurs
285 * @see #execute
286 */
287 public int getUpdateCount() throws SQLException {
288 return 0;
289 }
290
291 /**
292 * Moves to a <code>SapQLStatement</code> object's next result. It returns
293 * <code>true</code> if this result is a <code>ResultSet</code> object.
294 * This method also implicitly closes any current <code>ResultSet</code>
295 * object obtained with the method <code>getResultSet</code>.
296 * <p/>
297 * <P>There are no more results when the following is true:
298 * <PRE>
299 * <code>(!getMoreResults() && (getUpdateCount() == -1)</code>
300 * </PRE>
301 *
302 * @return <code>true</code> if the next result is a <code>ResultSet</code> object;
303 * <code>false</code> if it is an update count or there are no more results
304 * @throws java.sql.SQLException if a database access error occurs
305 * @see #execute
306 */
307 public boolean getMoreResults() throws SQLException {
308 return false;
309 }
310
311 /**
312 * Gives the driver a hint as to the direction in which
313 * the rows in a result set
314 * will be processed. The hint applies only to result sets created
315 * using this <code>SapQLStatement</code> object. The default value is
316 * <code>ResultSet.FETCH_FORWARD</code>.
317 * <p>Note that this method sets the default fetch direction for
318 * result sets generated by this <code>SapQLStatement</code> object.
319 * Each result set has its own methods for getting and setting
320 * its own fetch direction.
321 *
322 * @param direction the initial direction for processing rows
323 * @throws java.sql.SQLException if a database access error occurs
324 * or the given direction
325 * is not one of <code>ResultSet.FETCH_FORWARD</code>,
326 * <code>ResultSet.FETCH_REVERSE</code>, or <code>ResultSet.FETCH_UNKNOWN</code>
327 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
328 * 2.0 API</a>
329 * @since 1.2
330 */
331 public void setFetchDirection(int direction) throws SQLException {
332
333 }
334
335 /**
336 * Retrieves the direction for fetching rows from
337 * database tables that is the default for result sets
338 * generated from this <code>SapQLStatement</code> object.
339 * If this <code>SapQLStatement</code> object has not set
340 * a fetch direction by calling the method <code>setFetchDirection</code>,
341 * the return value is implementation-specific.
342 *
343 * @return the default fetch direction for result sets generated
344 * from this <code>SapQLStatement</code> object
345 * @throws java.sql.SQLException if a database access error occurs
346 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
347 * 2.0 API</a>
348 * @since 1.2
349 */
350 public int getFetchDirection() throws SQLException {
351 return 0;
352 }
353
354 /**
355 * Gives the JDBC driver a hint as to the number of rows that should
356 * be fetched from the database when more rows are needed. The number
357 * of rows specified affects only result sets created using this
358 * statement. If the value specified is zero, then the hint is ignored.
359 * The default value is zero.
360 *
361 * @param rows the number of rows to fetch
362 * @throws java.sql.SQLException if a database access error occurs, or the
363 * condition 0 <= rows <= this.getMaxRows() is not satisfied.
364 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
365 * 2.0 API</a>
366 * @since 1.2
367 */
368 public void setFetchSize(int rows) throws SQLException {
369
370 }
371
372 /**
373 * Retrieves the number of result set rows that is the default
374 * fetch size for result sets
375 * generated from this <code>SapQLStatement</code> object.
376 * If this <code>SapQLStatement</code> object has not set
377 * a fetch size by calling the method <code>setFetchSize</code>,
378 * the return value is implementation-specific.
379 *
380 * @return the default fetch size for result sets generated
381 * from this <code>SapQLStatement</code> object
382 * @throws java.sql.SQLException if a database access error occurs
383 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
384 * 2.0 API</a>
385 * @since 1.2
386 */
387 public int getFetchSize() throws SQLException {
388 return 0;
389 }
390
391 /**
392 * Retrieves the result set concurrency for <code>ResultSet</code> objects
393 * generated by this <code>SapQLStatement</code> object.
394 *
395 * @return either <code>ResultSet.CONCUR_READ_ONLY</code> or
396 * <code>ResultSet.CONCUR_UPDATABLE</code>
397 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
398 * 2.0 API</a>
399 * @since 1.2
400 */
401 public int getResultSetConcurrency() throws SQLException {
402 return 0;
403 }
404
405 /**
406 * Retrieves the result set type for <code>ResultSet</code> objects
407 * generated by this <code>SapQLStatement</code> object.
408 *
409 * @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>,
410 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
411 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
412 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
413 * 2.0 API</a>
414 * @since 1.2
415 */
416 public int getResultSetType() throws SQLException {
417 return 0;
418 }
419
420 /**
421 * Adds an SQL command to the current batch of commmands for this
422 * <code>SapQLStatement</code> object. This method is optional.
423 *
424 * @param sql typically this is a static SQL <code>INSERT</code> or
425 * <code>UPDATE</code> statement
426 * @throws java.sql.SQLException if a database access error occurs, or the
427 * driver does not support batch statements
428 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
429 * 2.0 API</a>
430 * @since 1.2
431 */
432 public void addBatch(String sql) throws SQLException {
433
434 }
435
436 /**
437 * Makes the set of commands in the current batch empty.
438 * This method is optional.
439 *
440 * @throws java.sql.SQLException if a database access error occurs or the
441 * driver does not support batch statements
442 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
443 * 2.0 API</a>
444 * @since 1.2
445 */
446 public void clearBatch() throws SQLException {
447
448 }
449
450 /**
451 * Submits a batch of commands to the database for execution and
452 * if all commands execute successfully, returns an array of update counts.
453 * The <code>int</code> elements of the array that is returned are ordered
454 * to correspond to the commands in the batch, which are ordered
455 * according to the order in which they were added to the batch.
456 * The elements in the array returned by the method <code>executeBatch</code>
457 * may be one of the following:
458 * <OL>
459 * <LI>A number greater than or equal to zero -- indicates that the
460 * command was processed successfully and is an update count giving the
461 * number of rows in the database that were affected by the command's
462 * execution
463 * <LI>A value of <code>-2</code> -- indicates that the command was
464 * processed successfully but that the number of rows affected is
465 * unknown
466 * <p/>
467 * If one of the commands in a batch update fails to execute properly,
468 * this method throws a <code>BatchUpdateException</code>, and a JDBC
469 * driver may or may not continue to process the remaining commands in
470 * the batch. However, the driver's behavior must be consistent with a
471 * particular DBMS, either always continuing to process commands or never
472 * continuing to process commands. If the driver continues processing
473 * after a failure, the array returned by the method
474 * <code>BatchUpdateException.getUpdateCounts</code>
475 * will contain as many elements as there are commands in the batch, and
476 * at least one of the elements will be the following:
477 * <p/>
478 * <LI>A value of <code>-3</code> -- indicates that the command failed
479 * to execute successfully and occurs only if a driver continues to
480 * process commands after a command fails
481 * </OL>
482 * <p/>
483 * A driver is not required to implement this method.
484 * The possible implementations and return values have been modified in
485 * the Java 2 SDK, Standard Edition, version 1.3 to
486 * accommodate the option of continuing to proccess commands in a batch
487 * update after a <code>BatchUpdateException</code> obejct has been thrown.
488 *
489 * @return an array of update counts containing one element for each
490 * command in the batch. The elements of the array are ordered according
491 * to the order in which commands were added to the batch.
492 * @throws java.sql.SQLException if a database access error occurs or the
493 * driver does not support batch statements. Throws {@link java.sql.BatchUpdateException}
494 * (a subclass of <code>SQLException</code>) if one of the commands sent to the
495 * database fails to execute properly or attempts to return a result set.
496 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
497 * 2.0 API</a>
498 * @since 1.3
499 */
500 public int[] executeBatch() throws SQLException {
501 return new int[0];
502 }
503
504 /**
505 * Returns the <code>SapConnection</code> object
506 * that produced this <code>SapQLStatement</code> object.
507 *
508 * @return the connection that produced this statement
509 * @throws java.sql.SQLException if a database access error occurs
510 * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
511 * 2.0 API</a>
512 * @since 1.2
513 */
514 public Connection getConnection() throws SQLException {
515 return null;
516 }
517
518 /**
519 * Retrieves the result set holdability for <code>ResultSet</code> objects
520 * generated by this <code>Statement</code> object.
521 *
522 * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
523 * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
524 * @throws java.sql.SQLException if a database access error occurs
525 * @since 1.4
526 */
527 public int getResultSetHoldability() throws SQLException {
528 return 0;
529 }
530
531 /**
532 * Moves to this <code>Statement</code> object's next result, deals with
533 * any current <code>ResultSet</code> object(s) according to the instructions
534 * specified by the given flag, and returns
535 * <code>true</code> if the next result is a <code>ResultSet</code> object.
536 * <p/>
537 * <P>There are no more results when the following is true:
538 * <PRE>
539 * // stmt is a Statement object
540 * ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
541 * </PRE>
542 *
543 * @param current one of the following <code>Statement</code>
544 * constants indicating what should happen to current
545 * <code>ResultSet</code> objects obtained using the method
546 * <code>getResultSet</code>:
547 * <code>Statement.CLOSE_CURRENT_RESULT</code>,
548 * <code>Statement.KEEP_CURRENT_RESULT</code>, or
549 * <code>Statement.CLOSE_ALL_RESULTS</code>
550 * @return <code>true</code> if the next result is a <code>ResultSet</code>
551 * object; <code>false</code> if it is an update count or there are no
552 * more results
553 * @throws java.sql.SQLException if a database access error occurs or the argument
554 * supplied is not one of the following:
555 * <code>Statement.CLOSE_CURRENT_RESULT</code>,
556 * <code>Statement.KEEP_CURRENT_RESULT</code>, or
557 * <code>Statement.CLOSE_ALL_RESULTS</code>
558 * @see #execute
559 * @since 1.4
560 */
561 public boolean getMoreResults(int current) throws SQLException {
562 return false;
563 }
564
565 /**
566 * Executes the given SQL statement and signals the driver with the
567 * given flag about whether the
568 * auto-generated keys produced by this <code>Statement</code> object
569 * should be made available for retrieval.
570 *
571 * @param sql must be an SQL <code>INSERT</code>, <code>UPDATE</code> or
572 * <code>DELETE</code> statement or an SQL statement that
573 * returns nothing
574 * @param autoGeneratedKeys a flag indicating whether auto-generated keys
575 * should be made available for retrieval;
576 * one of the following constants:
577 * <code>Statement.RETURN_GENERATED_KEYS</code>
578 * <code>Statement.NO_GENERATED_KEYS</code>
579 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>
580 * or <code>DELETE</code> statements, or <code>0</code> for SQL
581 * statements that return nothing
582 * @throws java.sql.SQLException if a database access error occurs, the given
583 * SQL statement returns a <code>ResultSet</code> object, or
584 * the given constant is not one of those allowed
585 * @since 1.4
586 */
587 public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
588 return 0;
589 }
590
591 /**
592 * Executes the given SQL statement, which may return multiple results,
593 * and signals the driver that any
594 * auto-generated keys should be made available
595 * for retrieval. The driver will ignore this signal if the SQL statement
596 * is not an <code>INSERT</code> statement.
597 * <p/>
598 * In some (uncommon) situations, a single SQL statement may return
599 * multiple result sets and/or update counts. Normally you can ignore
600 * this unless you are (1) executing a stored procedure that you know may
601 * return multiple results or (2) you are dynamically executing an
602 * unknown SQL string.
603 * <p/>
604 * The <code>execute</code> method executes an SQL statement and indicates the
605 * form of the first result. You must then use the methods
606 * <code>getResultSet</code> or <code>getUpdateCount</code>
607 * to retrieve the result, and <code>getMoreResults</code> to
608 * move to any subsequent result(s).
609 *
610 * @param sql any SQL statement
611 * @param autoGeneratedKeys a constant indicating whether auto-generated
612 * keys should be made available for retrieval using the method
613 * <code>getGeneratedKeys</code>; one of the following constants:
614 * <code>Statement.RETURN_GENERATED_KEYS</code> or
615 * <code>Statement.NO_GENERATED_KEYS</code>
616 * @return <code>true</code> if the first result is a <code>ResultSet</code>
617 * object; <code>false</code> if it is an update count or there are
618 * no results
619 * @throws java.sql.SQLException if a database access error occurs or the second
620 * parameter supplied to this method is not
621 * <code>Statement.RETURN_GENERATED_KEYS</code> or
622 * <code>Statement.NO_GENERATED_KEYS</code>.
623 * @see #getResultSet
624 * @see #getUpdateCount
625 * @see #getMoreResults
626 * @see #getGeneratedKeys
627 * @since 1.4
628 */
629 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
630 return false;
631 }
632
633 /**
634 * Executes the given SQL statement and signals the driver that the
635 * auto-generated keys indicated in the given array should be made available
636 * for retrieval. The driver will ignore the array if the SQL statement
637 * is not an <code>INSERT</code> statement.
638 *
639 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
640 * <code>DELETE</code> statement or an SQL statement that returns nothing,
641 * such as an SQL DDL statement
642 * @param columnIndexes an array of column indexes indicating the columns
643 * that should be returned from the inserted row
644 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
645 * or <code>DELETE</code> statements, or 0 for SQL statements
646 * that return nothing
647 * @throws java.sql.SQLException if a database access error occurs, the SQL
648 * statement returns a <code>ResultSet</code> object, or the
649 * second argument supplied to this method is not an <code>int</code> array
650 * whose elements are valid column indexes
651 * @since 1.4
652 */
653 public int executeUpdate(String sql, int columnIndexes[]) throws SQLException {
654 return 0;
655 }
656
657 /**
658 * Executes the given SQL statement, which may return multiple results,
659 * and signals the driver that the
660 * auto-generated keys indicated in the given array should be made available
661 * for retrieval. This array contains the indexes of the columns in the
662 * target table that contain the auto-generated keys that should be made
663 * available. The driver will ignore the array if the given SQL statement
664 * is not an <code>INSERT</code> statement.
665 * <p/>
666 * Under some (uncommon) situations, a single SQL statement may return
667 * multiple result sets and/or update counts. Normally you can ignore
668 * this unless you are (1) executing a stored procedure that you know may
669 * return multiple results or (2) you are dynamically executing an
670 * unknown SQL string.
671 * <p/>
672 * The <code>execute</code> method executes an SQL statement and indicates the
673 * form of the first result. You must then use the methods
674 * <code>getResultSet</code> or <code>getUpdateCount</code>
675 * to retrieve the result, and <code>getMoreResults</code> to
676 * move to any subsequent result(s).
677 *
678 * @param sql any SQL statement
679 * @param columnIndexes an array of the indexes of the columns in the
680 * inserted row that should be made available for retrieval by a
681 * call to the method <code>getGeneratedKeys</code>
682 * @return <code>true</code> if the first result is a <code>ResultSet</code>
683 * object; <code>false</code> if it is an update count or there
684 * are no results
685 * @throws java.sql.SQLException if a database access error occurs or the
686 * elements in the <code>int</code> array passed to this method
687 * are not valid column indexes
688 * @see #getResultSet
689 * @see #getUpdateCount
690 * @see #getMoreResults
691 * @since 1.4
692 */
693 public boolean execute(String sql, int columnIndexes[]) throws SQLException {
694 return false;
695 }
696
697 /**
698 * Retrieves any auto-generated keys created as a result of executing this
699 * <code>Statement</code> object. If this <code>Statement</code> object did
700 * not generate any keys, an empty <code>ResultSet</code>
701 * object is returned.
702 *
703 * @return a <code>ResultSet</code> object containing the auto-generated key(s)
704 * generated by the execution of this <code>Statement</code> object
705 * @throws java.sql.SQLException if a database access error occurs
706 * @since 1.4
707 */
708 public ResultSet getGeneratedKeys() throws SQLException {
709 return null;
710 }
711
712 /**
713 * Executes the given SQL statement and signals the driver that the
714 * auto-generated keys indicated in the given array should be made available
715 * for retrieval. The driver will ignore the array if the SQL statement
716 * is not an <code>INSERT</code> statement.
717 *
718 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
719 * <code>DELETE</code> statement or an SQL statement that returns nothing
720 * @param columnNames an array of the names of the columns that should be
721 * returned from the inserted row
722 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
723 * or <code>DELETE</code> statements, or 0 for SQL statements
724 * that return nothing
725 * @throws java.sql.SQLException if a database access error occurs, the SQL
726 * statement returns a <code>ResultSet</code> object, or the
727 * second argument supplied to this method is not a <code>String</code> array
728 * whose elements are valid column names
729 * @since 1.4
730 */
731 public int executeUpdate(String sql, String columnNames[]) throws SQLException {
732 return 0;
733 }
734
735 /**
736 * Executes the given SQL statement, which may return multiple results,
737 * and signals the driver that the
738 * auto-generated keys indicated in the given array should be made available
739 * for retrieval. This array contains the names of the columns in the
740 * target table that contain the auto-generated keys that should be made
741 * available. The driver will ignore the array if the given SQL statement
742 * is not an <code>INSERT</code> statement.
743 * <p/>
744 * In some (uncommon) situations, a single SQL statement may return
745 * multiple result sets and/or update counts. Normally you can ignore
746 * this unless you are (1) executing a stored procedure that you know may
747 * return multiple results or (2) you are dynamically executing an
748 * unknown SQL string.
749 * <p/>
750 * The <code>execute</code> method executes an SQL statement and indicates the
751 * form of the first result. You must then use the methods
752 * <code>getResultSet</code> or <code>getUpdateCount</code>
753 * to retrieve the result, and <code>getMoreResults</code> to
754 * move to any subsequent result(s).
755 *
756 * @param sql any SQL statement
757 * @param columnNames an array of the names of the columns in the inserted
758 * row that should be made available for retrieval by a call to the
759 * method <code>getGeneratedKeys</code>
760 * @return <code>true</code> if the next result is a <code>ResultSet</code>
761 * object; <code>false</code> if it is an update count or there
762 * are no more results
763 * @throws java.sql.SQLException if a database access error occurs or the
764 * elements of the <code>String</code> array passed to this
765 * method are not valid column names
766 * @see #getResultSet
767 * @see #getUpdateCount
768 * @see #getMoreResults
769 * @see #getGeneratedKeys
770 * @since 1.4
771 */
772 public boolean execute(String sql, String columnNames[]) throws SQLException {
773 return false;
774 }
775 }