Skip to content

Package: PreparedStatement

PreparedStatement

Coverage

1: /**
2: * Copyright (C) 2016 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.ontodriver;
16:
17: import cz.cvut.kbss.ontodriver.exception.OntoDriverException;
18:
19: /**
20: * This interface extends the {@code Statement} and adds the possibility to parametrize queries
21: * <p>
22: * Implementations are also expected to support at least a basic level of character escaping (e. g. quotes) and other
23: * injection-protection methods.
24: *
25: * @author kidney
26: */
27: public interface PreparedStatement extends Statement {
28:
29: /**
30: * Executes query represented by this statement. </p>
31: *
32: * @return ResultSet of the query
33: * @throws OntoDriverException If an ontology access error occurs
34: * @throws IllegalStateException If called on a closed statement
35: */
36: ResultSet executeQuery() throws OntoDriverException;
37:
38: /**
39: * Executes an update represented by this statement.
40: *
41: * @throws OntoDriverException If an ontology access error occurs
42: * @throws IllegalStateException If called on a closed statement
43: */
44: void executeUpdate() throws OntoDriverException;
45:
46: /**
47: * Sets value of binding with the specified name.
48: *
49: * @param binding Binding name
50: * @param value The value of the parameter
51: * @throws OntoDriverException If there is no such binding in the statement or some other error occurs
52: * @throws IllegalStateException If called on a closed statement
53: */
54: void setObject(String binding, Object value) throws OntoDriverException;
55:
56: /**
57: * Clears the currently set parameters.
58: *
59: * @throws OntoDriverException If an ontology access error occurs
60: * @throws IllegalStateException If called on a closed statement
61: */
62: void clearParameters() throws OntoDriverException;
63: }