1 | /* |
---|
2 | Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. |
---|
3 | |
---|
4 | This program is free software; you can redistribute it and/or modify |
---|
5 | it under the terms of version 2 of the GNU General Public License as |
---|
6 | published by the Free Software Foundation. |
---|
7 | |
---|
8 | There are special exceptions to the terms and conditions of the GPL |
---|
9 | as it is applied to this software. View the full text of the |
---|
10 | exception in file EXCEPTIONS-CONNECTOR-J in the directory of this |
---|
11 | software distribution. |
---|
12 | |
---|
13 | This program is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | GNU General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with this program; if not, write to the Free Software |
---|
20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
21 | |
---|
22 | */ |
---|
23 | |
---|
24 | package com.mysql.jdbc; |
---|
25 | |
---|
26 | import java.io.InputStream; |
---|
27 | import java.sql.ResultSet; |
---|
28 | import java.sql.SQLException; |
---|
29 | |
---|
30 | /** |
---|
31 | * This interface contains methods that are considered the "vendor extension" |
---|
32 | * to the JDBC API for MySQL's implementation of java.sql.Statement. |
---|
33 | * |
---|
34 | * For those looking further into the driver implementation, it is not |
---|
35 | * an API that is used for plugability of implementations inside our driver |
---|
36 | * (which is why there are still references to StatementImpl throughout the |
---|
37 | * code). |
---|
38 | * |
---|
39 | * @version $Id: $ |
---|
40 | * |
---|
41 | */ |
---|
42 | public interface Statement extends java.sql.Statement { |
---|
43 | |
---|
44 | /** |
---|
45 | * Workaround for containers that 'check' for sane values of |
---|
46 | * Statement.setFetchSize() so that applications can use |
---|
47 | * the Java variant of libmysql's mysql_use_result() behavior. |
---|
48 | * |
---|
49 | * @throws SQLException |
---|
50 | */ |
---|
51 | public abstract void enableStreamingResults() throws SQLException; |
---|
52 | |
---|
53 | /** |
---|
54 | * Resets this statements fetch size and result set type to the values |
---|
55 | * they had before enableStreamingResults() was called. |
---|
56 | * |
---|
57 | * @throws SQLException |
---|
58 | */ |
---|
59 | public abstract void disableStreamingResults() throws SQLException; |
---|
60 | |
---|
61 | /** |
---|
62 | * Sets an InputStream instance that will be used to send data |
---|
63 | * to the MySQL server for a "LOAD DATA LOCAL INFILE" statement |
---|
64 | * rather than a FileInputStream or URLInputStream that represents |
---|
65 | * the path given as an argument to the statement. |
---|
66 | * |
---|
67 | * This stream will be read to completion upon execution of a |
---|
68 | * "LOAD DATA LOCAL INFILE" statement, and will automatically |
---|
69 | * be closed by the driver, so it needs to be reset |
---|
70 | * before each call to execute*() that would cause the MySQL |
---|
71 | * server to request data to fulfill the request for |
---|
72 | * "LOAD DATA LOCAL INFILE". |
---|
73 | * |
---|
74 | * If this value is set to NULL, the driver will revert to using |
---|
75 | * a FileInputStream or URLInputStream as required. |
---|
76 | */ |
---|
77 | public abstract void setLocalInfileInputStream(InputStream stream); |
---|
78 | |
---|
79 | /** |
---|
80 | * Returns the InputStream instance that will be used to send |
---|
81 | * data in response to a "LOAD DATA LOCAL INFILE" statement. |
---|
82 | * |
---|
83 | * This method returns NULL if no such stream has been set |
---|
84 | * via setLocalInfileInputStream(). |
---|
85 | */ |
---|
86 | public abstract InputStream getLocalInfileInputStream(); |
---|
87 | |
---|
88 | public void setPingTarget(PingTarget pingTarget); |
---|
89 | |
---|
90 | public ExceptionInterceptor getExceptionInterceptor(); |
---|
91 | |
---|
92 | /** |
---|
93 | * Callback for result set instances to remove them from the Set that |
---|
94 | * tracks them per-statement |
---|
95 | */ |
---|
96 | |
---|
97 | public abstract void removeOpenResultSet(ResultSet rs); |
---|
98 | |
---|
99 | /** |
---|
100 | * Returns the number of open result sets for this statement. |
---|
101 | * @return |
---|
102 | */ |
---|
103 | public abstract int getOpenResultSetCount(); |
---|
104 | |
---|
105 | public void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose); |
---|
106 | } |
---|