File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/main/java/org/owasp/benchmark/helpers Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 33
33
import org .owasp .esapi .ESAPI ;
34
34
35
35
public class DatabaseHelper {
36
- private static Statement stmt ;
37
36
private static Connection conn ;
38
37
public static org .springframework .jdbc .core .JdbcTemplate JDBCtemplate ;
39
38
public static org .owasp .benchmark .helpers .HibernateUtil hibernateUtil =
@@ -120,13 +119,11 @@ public static java.sql.Statement getSqlStatement() {
120
119
if (conn == null ) {
121
120
getSqlConnection ();
122
121
}
123
-
124
- if (stmt == null ) {
125
- try {
126
- stmt = conn .createStatement ();
127
- } catch (SQLException e ) {
128
- System .out .println ("Problem with database init." );
129
- }
122
+ Statement stmt = null ;
123
+ try {
124
+ stmt = conn .createStatement ();
125
+ } catch (SQLException e ) {
126
+ System .out .println ("Problem with database init." );
130
127
}
131
128
132
129
return stmt ;
@@ -172,9 +169,7 @@ public static java.sql.Connection getSqlConnection() {
172
169
}
173
170
174
171
public static void executeSQLCommand (String sql ) throws Exception {
175
- if (stmt == null ) {
176
- getSqlStatement ();
177
- }
172
+ Statement stmt = getSqlStatement ();
178
173
stmt .executeUpdate (sql );
179
174
}
180
175
You can’t perform that action at this time.
0 commit comments