📄 webapp.java
字号:
// $Id: WebApp.java,v 1.1 2002/07/18 09:08:03 per_nyfelt Exp $package webapp;import org.apache.log4j.Category;import song.SongServices;import org.ozoneDB.*;/** * Aplication singleton for the Web Application * * @version $Revision: 1.1 $ $Date: 2002/07/18 09:08:03 $ * @author James Stiefel */public class WebApp { private static ExternalDatabase db = null; /** * log4j logger */ private static Category logger = Category.getInstance(WebApp.class.getName()); /** * Initialize the system - establish database connection, etc. * */ public static void init() { //config log4j logger : log4j.properties will automatically load //PropertyConfigurator.configure("log4j.properties"); try { logger.info("init()"); //TODO: configuration for the database URL might be nice // create and open a new database connection db = ExternalDatabase.openDatabase( "ozonedb:remote://localhost:3333" ); if (db == null){ logger.warn("init(): db == null -- something went wrong."); } logger.info( "Connected ..." ); db.reloadClasses(); SongServices.init(db); } catch (Exception e){ logger.error("init() failed", e); } } /** * Close down the application -- disconnect from the database, etc. * */ public static void term() { //close up the database logger.info("term()"); SongServices.term(); try { db.close(); } catch (Exception e){ e.printStackTrace(); } db = null; } /** * Get the database instance. * */ public static OzoneInterface database(){ return db; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -