|
6 | 6 |
|
7 | 7 | public interface IQuery { |
8 | 8 |
|
| 9 | + /** |
| 10 | + * Specify what values will be affected for example: |
| 11 | + * query.where("first_name = ? AND last_name = ?", "Denzel", "Code"); |
| 12 | + * @param where Where statement. |
| 13 | + * @param execute Values of the statement. |
| 14 | + * @return Query object. |
| 15 | + */ |
9 | 16 | IQuery where(String where, Object... execute); |
10 | 17 |
|
| 18 | + /** |
| 19 | + * Specify what values will be affected for example: |
| 20 | + * query.where("first_name = 'Denzel' AND last_name = 'Code'"); |
| 21 | + * @param where Where statement. |
| 22 | + * @return Query object. |
| 23 | + */ |
11 | 24 | IQuery where(String where); |
12 | 25 |
|
| 26 | + /** |
| 27 | + * Execute query and return a boolean. |
| 28 | + * Recommended for: CREATE, ALTER, DROP, TRUNCATE. |
| 29 | + * @return boolean. |
| 30 | + * @throws SQLException Exception when something goes wrong. |
| 31 | + */ |
13 | 32 | Boolean executeStatement() throws SQLException; |
14 | 33 |
|
| 34 | + /** |
| 35 | + * Execute query and return an integer. |
| 36 | + * Recommended for: INSERT, UPDATE, DELETE. |
| 37 | + * @return integer. |
| 38 | + * @throws SQLException Exception when something goes wrong. |
| 39 | + */ |
15 | 40 | int executeUpdate() throws SQLException; |
16 | 41 |
|
| 42 | + /** |
| 43 | + * Execute query and return a ResultSet. |
| 44 | + * Recommended for: SELECT, SHOW. |
| 45 | + * @return ResultSet. |
| 46 | + * @throws SQLException Exception when something goes wrong. |
| 47 | + */ |
17 | 48 | ResultSet executeQuery() throws SQLException; |
18 | 49 |
|
| 50 | + /** |
| 51 | + * Execute query and return a PreparedStatement. |
| 52 | + * Recommended for: General. |
| 53 | + * @return PreparedStatement. |
| 54 | + * @throws SQLException Exception when something goes wrong. |
| 55 | + */ |
19 | 56 | PreparedStatement executePrepare() throws SQLException; |
20 | 57 |
|
| 58 | + /** |
| 59 | + * Get PreparedStatement of the query. |
| 60 | + * This just works if you already executed the query. |
| 61 | + * @return PreparedStatement. |
| 62 | + */ |
| 63 | + PreparedStatement getPrepare(); |
| 64 | + |
| 65 | + /** |
| 66 | + * @return String representation of the Query. |
| 67 | + */ |
21 | 68 | String toQuery(); |
| 69 | + |
| 70 | + /** |
| 71 | + * @return String representation of the Query. |
| 72 | + */ |
| 73 | + String toString(); |
22 | 74 | } |
0 commit comments