MCPcopy Index your code
hub / github.com/OWASP/SecurityShepherd / executeUpdateScript

Method executeUpdateScript

src/main/java/servlets/Setup.java:167–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165 }
166
167 private synchronized void executeUpdateScript() throws InstallationException {
168
169 try {
170 File file = new File(getClass().getClassLoader().getResource("/database/updatev3_0tov3_1.sql").getFile());
171 String data = FileUtils.readFileToString(file, Charset.defaultCharset() );
172
173 Connection databaseConnection = Database.getDatabaseConnection(null, true);
174 Statement psProcToexecute = databaseConnection.createStatement();
175 psProcToexecute.executeUpdate(data);
176
177 } catch (Exception e) {
178 log.fatal(e);
179 e.printStackTrace();
180 throw new InstallationException(e);
181 }
182 }
183}

Callers 1

doPostMethod · 0.95

Calls 1

getDatabaseConnectionMethod · 0.95

Tested by

no test coverage detected