private static Db createFactory() { try { Properties p = Db.loadProperties(); Db n = new Db(p); p.put("com.enioka.jqm.jdbc.contextobject", n); // Share the DataSource in engine and client. JqmClientFactory.setProperties(p); return n; } catch (Exception e) { jqmlogger.error("Unable to connect with the database. Maybe your configuration file is wrong. " + "Please check the password or the url in the $JQM_DIR/conf/resources.xml", e); throw new JqmInitError("Database connection issue", e); } }
private static Db createFactory() { try { Properties p = Db.loadProperties(); Db n = new Db(p); p.put("com.enioka.jqm.jdbc.contextobject", n); // Share the DataSource in engine and client. JqmClientFactory.setProperties(p); return n; } catch (Exception e) { jqmlogger.error("Unable to connect with the database. Maybe your configuration file is wrong. " + "Please check the password or the url in the $JQM_DIR/conf/resources.xml", e); throw new JqmInitError("Database connection issue", e); } }
private void close() { s.stop(); s.shutdown(); cnx.close(); JqmClientFactory.resetClient(); JqmClientFactory.setProperties(new Properties()); }
private void close() { s.stop(); s.shutdown(); cnx.close(); JqmClientFactory.resetClient(); JqmClientFactory.setProperties(new Properties()); }
JqmClientFactory.setProperties(p2);
JqmClientFactory.setProperties(p2);
public JqmAsyncTester() { // Ext dir File extDir = new File("./ext"); if (!extDir.exists() && !extDir.mkdir()) { throw new RuntimeException(new IOException("./ext directory does not exist and cannot create it")); } s = Common.createHsqlServer(); s.start(); JDBCDataSource ds = new JDBCDataSource(); ds.setDatabase("jdbc:hsqldb:mem:" + s.getDatabaseName(0, true)); db = new Db(ds, true); cnx = db.getConn(); Properties p2 = Common.dbProperties(s); p2.put("com.enioka.jqm.jdbc.contextobject", db); JqmClientFactory.setProperties(p2); JqmEngineFactory.setDatasource(db); JqmEngineFactory.initializeMetadata(); cnx.runUpdate("dp_delete_all"); cnx.runUpdate("q_delete_all"); cnx.commit(); // Needed parameters addGlobalParameter("defaultConnection", ""); addGlobalParameter("disableWsApi", "true"); addGlobalParameter("logFilePerLaunch", "false"); // Prepare DB }
public JqmAsyncTester() { // Ext dir File extDir = new File("./ext"); if (!extDir.exists() && !extDir.mkdir()) { throw new RuntimeException(new IOException("./ext directory does not exist and cannot create it")); } s = Common.createHsqlServer(); s.start(); JDBCDataSource ds = new JDBCDataSource(); ds.setDatabase("jdbc:hsqldb:mem:" + s.getDatabaseName(0, true)); db = new Db(ds, true); cnx = db.getConn(); Properties p2 = Common.dbProperties(s); p2.put("com.enioka.jqm.jdbc.contextobject", db); JqmClientFactory.setProperties(p2); JqmEngineFactory.setDatasource(db); JqmEngineFactory.initializeMetadata(); cnx.runUpdate("dp_delete_all"); cnx.runUpdate("q_delete_all"); cnx.commit(); // Needed parameters addGlobalParameter("defaultConnection", ""); addGlobalParameter("disableWsApi", "true"); addGlobalParameter("logFilePerLaunch", "false"); // Prepare DB }