-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathSQLConnection.java
More file actions
34 lines (26 loc) · 864 Bytes
/
SQLConnection.java
File metadata and controls
34 lines (26 loc) · 864 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
package sqlancer;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.sql.Statement;
public class SQLConnection implements SQLancerDBConnection {
private final Connection connection;
public SQLConnection(Connection connection) {
this.connection = connection;
}
@Override
public String getDatabaseVersion() throws SQLException {
DatabaseMetaData meta = connection.getMetaData();
return meta.getDatabaseProductVersion();
}
@Override
public void close() throws SQLException {
connection.close();
}
public Statement prepareStatement(String arg) throws SQLException {
return connection.prepareStatement(arg);
}
public Statement createStatement() throws SQLException {
return connection.createStatement();
}
}