01: /*
02: Copyright (C) 2007 MySQL AB
03:
04: This program is free software; you can redistribute it and/or modify
05: it under the terms of version 2 of the GNU General Public License as
06: published by the Free Software Foundation.
07:
08: There are special exceptions to the terms and conditions of the GPL
09: 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.SQLException;
28:
29: /**
30: * This interface contains methods that are considered the "vendor extension"
31: * to the JDBC API for MySQL's implementation of java.sql.Statement.
32: *
33: * For those looking further into the driver implementation, it is not
34: * an API that is used for plugability of implementations inside our driver
35: * (which is why there are still references to StatementImpl throughout the
36: * code).
37: *
38: * @version $Id: $
39: *
40: */
41: public interface Statement extends java.sql.Statement {
42:
43: /**
44: * Workaround for containers that 'check' for sane values of
45: * Statement.setFetchSize() so that applications can use
46: * the Java variant of libmysql's mysql_use_result() behavior.
47: *
48: * @throws SQLException
49: */
50: public abstract void enableStreamingResults() throws SQLException;
51:
52: /**
53: * Resets this statements fetch size and result set type to the values
54: * they had before enableStreamingResults() was called.
55: *
56: * @throws SQLException
57: */
58: public abstract void disableStreamingResults() throws SQLException;
59:
60: /**
61: * Sets an InputStream instance that will be used to send data
62: * to the MySQL server for a "LOAD DATA LOCAL INFILE" statement
63: * rather than a FileInputStream or URLInputStream that represents
64: * the path given as an argument to the statement.
65: *
66: * This stream will be read to completion upon execution of a
67: * "LOAD DATA LOCAL INFILE" statement, and will automatically
68: * be closed by the driver, so it needs to be reset
69: * before each call to execute*() that would cause the MySQL
70: * server to request data to fulfill the request for
71: * "LOAD DATA LOCAL INFILE".
72: *
73: * If this value is set to NULL, the driver will revert to using
74: * a FileInputStream or URLInputStream as required.
75: */
76: public abstract void setLocalInfileInputStream(InputStream stream);
77:
78: /**
79: * Returns the InputStream instance that will be used to send
80: * data in response to a "LOAD DATA LOCAL INFILE" statement.
81: *
82: * This method returns NULL if no such stream has been set
83: * via setLocalInfileInputStream().
84: */
85: public abstract InputStream getLocalInfileInputStream();
86:
87: public void setPingTarget(PingTarget pingTarget);
88: }
|