📄 simple.java
字号:
package second;
import org.enhydra.shark.Shark;
import java.util.Properties;
import java.io.FileInputStream;
import utils.Util;
/**
* Not much more exciting, but it does correctly configure Shark.
* To do that, it has to go out and
*/
public class Simple
{
public static final String SHARK_INSTALL_DIR = "C:/Shark";
private static String path;
public static void main(String[] args)
{
try
{
Properties props = new Properties();
path = Util.forceSlash(SHARK_INSTALL_DIR) + "Shark.conf";
props.load(new FileInputStream(path));
System.out.println("Fixing up Shark config");
// Make SURE every instance of shark that connects to the same database uses a different
// enginename.
props.setProperty("enginename", "secondEngine");
Util.prependPath(props, "EXTERNAL_PACKAGES_REPOSITORY", SHARK_INSTALL_DIR);
Util.prependPath(props, "DatabaseManager.LogFile", SHARK_INSTALL_DIR);
Util.prependPath(props, "DatabaseManager.ConfigurationDir", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.Database.File", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.XMLOutFormatForPersistence.File", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.XMLOutFormatForPackageEvents.File", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.SharkExecution.File", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.XMLOutFormatForExecution.File", SHARK_INSTALL_DIR);
Util.prependPath(props, "log4j.appender.PackageEvents.File", SHARK_INSTALL_DIR);
Shark.configure(props);
}
catch (Exception e)
{
// It's not like I am going to revive the thing if it crashes...
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -