From 5803be55b75f062002bc9466868f76b9bbb814b5 Mon Sep 17 00:00:00 2001 From: Govindas Date: Sun, 7 Feb 2021 17:20:00 +0200 Subject: [PATCH] Support missing config options --- src/java/com/btk5h/skriptdb/skript/EffExecuteStatement.java | 2 +- src/java/com/btk5h/skriptdb/skript/ExprDataSource.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/com/btk5h/skriptdb/skript/EffExecuteStatement.java b/src/java/com/btk5h/skriptdb/skript/EffExecuteStatement.java index d003635..44f8ac6 100644 --- a/src/java/com/btk5h/skriptdb/skript/EffExecuteStatement.java +++ b/src/java/com/btk5h/skriptdb/skript/EffExecuteStatement.java @@ -51,7 +51,7 @@ public class EffExecuteStatement extends Effect { static String lastError; private static final ExecutorService threadPool = - Executors.newFixedThreadPool(SkriptDB.getInstance().getConfig().getInt("thread-pool-size")); + Executors.newFixedThreadPool(SkriptDB.getInstance().getConfig().getInt("thread-pool-size", 2)); private Expression query; private Expression dataSource; diff --git a/src/java/com/btk5h/skriptdb/skript/ExprDataSource.java b/src/java/com/btk5h/skriptdb/skript/ExprDataSource.java index 3e68bce..869418d 100644 --- a/src/java/com/btk5h/skriptdb/skript/ExprDataSource.java +++ b/src/java/com/btk5h/skriptdb/skript/ExprDataSource.java @@ -59,7 +59,7 @@ public class ExprDataSource extends SimpleExpression { HikariDataSource ds = new HikariDataSource(); //allow specifying of own sql driver class name - if (!SkriptDB.getInstance().getConfig().getString("sql-driver-class-name").equals("default")) { + if (!SkriptDB.getInstance().getConfig().getString("sql-driver-class-name", "default").equals("default")) { ds.setDriverClassName(SkriptDB.getInstance().getConfig().getString("sql-driver-class-name")); } ds.setJdbcUrl(jdbcUrl);