forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery.java
More file actions
38 lines (29 loc) · 863 Bytes
/
Query.java
File metadata and controls
38 lines (29 loc) · 863 Bytes
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
package sqlancer;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
public abstract class Query {
public abstract String getQueryString();
/**
* Whether the query could affect the schema (i.e., by add/deleting columns or tables).
*
* @return
*/
public abstract boolean couldAffectSchema();
/**
*
* @param con
* @return true if the query was successful, false otherwise
* @throws SQLException
*/
public abstract boolean execute(Connection con) throws SQLException;
public abstract Collection<String> getExpectedErrors();
@Override
public String toString() {
return getQueryString();
}
public ResultSet executeAndGet(Connection con) throws SQLException {
throw new AssertionError();
}
}