mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-13 15:23:40 +01:00
Applied patch from Steve to change the loading of the H2 db
Former-commit-id: 46d4bd628f0d7ecfaffc7881f8bc47bee6c55a5f
This commit is contained in:
@@ -182,13 +182,14 @@ public class CveDB {
|
||||
* @throws SQLException thrown if there is a SQL Exception
|
||||
* @throws DatabaseException thrown if there is an error initializing a new database
|
||||
*/
|
||||
public void open() throws IOException, SQLException, DatabaseException {
|
||||
public void open() throws IOException, SQLException, DatabaseException, ClassNotFoundException {
|
||||
final String fileName = CveDB.getDataDirectory().getCanonicalPath()
|
||||
+ File.separator
|
||||
+ "cve";
|
||||
final File f = new File(fileName);
|
||||
final boolean createTables = !f.exists();
|
||||
final String connStr = "jdbc:h2:file:" + fileName;
|
||||
Class.forName("org.h2.Driver");
|
||||
conn = DriverManager.getConnection(connStr, "sa", "");
|
||||
if (createTables) {
|
||||
createTables();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class NvdCveAnalyzer implements Analyzer {
|
||||
* @throws IOException thrown when there is an IO Exception
|
||||
* @throws DatabaseException thrown when there is a database exceptions
|
||||
*/
|
||||
public void open() throws SQLException, IOException, DatabaseException {
|
||||
public void open() throws SQLException, IOException, DatabaseException, ClassNotFoundException {
|
||||
cveDB = new CveDB();
|
||||
cveDB.open();
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ public class DatabaseUpdater implements CachedWebDataSource {
|
||||
throw new UpdateException(ex);
|
||||
} catch (DatabaseException ex) {
|
||||
throw new UpdateException(ex);
|
||||
} catch (ClassNotFoundException ex) {
|
||||
throw new UpdateException(ex);
|
||||
} finally {
|
||||
try {
|
||||
if (outputPath != null && outputPath.exists()) {
|
||||
@@ -181,7 +183,7 @@ public class DatabaseUpdater implements CachedWebDataSource {
|
||||
* @throws DatabaseException is thrown if there is a database exception
|
||||
*/
|
||||
private void importXML(File file, File oldVersion)
|
||||
throws ParserConfigurationException, SAXException, IOException, SQLException, DatabaseException {
|
||||
throws ParserConfigurationException, SAXException, IOException, SQLException, DatabaseException, ClassNotFoundException {
|
||||
CveDB cveDB = null;
|
||||
Index cpeIndex = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user