提交 2a280505 authored 作者: Thomas Mueller's avatar Thomas Mueller

To compile user defined functions, the javax.tools.JavaCompiler is now used if available

上级 55a2258a
...@@ -175,6 +175,16 @@ public class SysProperties { ...@@ -175,6 +175,16 @@ public class SysProperties {
* maximum delay. * maximum delay.
*/ */
public static final int DELAY_WRONG_PASSWORD_MAX = Utils.getProperty("h2.delayWrongPasswordMax", 4000); public static final int DELAY_WRONG_PASSWORD_MAX = Utils.getProperty("h2.delayWrongPasswordMax", 4000);
/**
* System property <code>h2.javaSystemCompiler</code> (default: true).<br />
* Whether to use the Java system compiler
* (ToolProvider.getSystemJavaCompiler()) if it is available to compile user
* defined functions. If disabled or if the system compiler is not
* available, the com.sun.tools.javac compiler is used if available, and
* "javac" (as an external process) is used if not.
*/
public static final boolean JAVA_SYSTEM_COMPILER = Utils.getProperty("h2.javaSystemCompiler", true);
/** /**
* System property <code>h2.lobCloseBetweenReads</code> (default: false).<br /> * System property <code>h2.lobCloseBetweenReads</code> (default: false).<br />
......
...@@ -24,6 +24,7 @@ import java.security.SecureClassLoader; ...@@ -24,6 +24,7 @@ import java.security.SecureClassLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.store.fs.FileUtils; import org.h2.store.fs.FileUtils;
...@@ -59,7 +60,7 @@ public class SourceCompiler { ...@@ -59,7 +60,7 @@ public class SourceCompiler {
*/ */
final HashMap<String, Class<?>> compiled = New.hashMap(); final HashMap<String, Class<?>> compiled = New.hashMap();
boolean useJavaSystemCompiler = true; boolean useJavaSystemCompiler = SysProperties.JAVA_SYSTEM_COMPILER;
static { static {
JavaCompiler c; JavaCompiler c;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论