-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathIQuery.java
More file actions
57 lines (48 loc) · 1.48 KB
/
Copy pathIQuery.java
File metadata and controls
57 lines (48 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package advancedsql.query;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public interface IQuery {
/**
* Execute query and return a boolean.
* Recommended for: CREATE, ALTER, DROP, TRUNCATE.
* @return boolean.
* @throws SQLException Exception when something goes wrong.
*/
Boolean executeStatement() throws SQLException;
/**
* Execute query and return an integer.
* Recommended for: INSERT, UPDATE, DELETE.
* @return integer.
* @throws SQLException Exception when something goes wrong.
*/
int executeUpdate() throws SQLException;
/**
* Execute query and return a ResultSet.
* Recommended for: SELECT, SHOW.
* @return ResultSet.
* @throws SQLException Exception when something goes wrong.
*/
ResultSet executeQuery() throws SQLException;
/**
* Execute query and return a PreparedStatement.
* Recommended for: General.
* @return PreparedStatement.
* @throws SQLException Exception when something goes wrong.
*/
PreparedStatement executePrepare() throws SQLException;
/**
* Get PreparedStatement of the query.
* This just works if you already executed the query.
* @return PreparedStatement.
*/
PreparedStatement getPrepare();
/**
* @return String representation of the Query.
*/
String toQuery();
/**
* @return String representation of the Query.
*/
String toString();
}