/** * Get a fresh connection on the engine database. * * @return a DbConn. */ static DbConn getNewDbSession() { getDb(); return _db.getConn(); }
/** * Get a fresh connection on the engine database. * * @return a DbConn. */ static DbConn getNewDbSession() { getDb(); return _db.getConn(); }
protected DbConn getNewDbSession() { DbConn cnx = db.getConn(); cnxs.add(cnx); return cnx; }
/** * Create the query cache (with db-specific queries) */ private void initQueries() { DbConn cnx = getConn(); adapter.prepare(p, cnx._cnx); cnx.close(); }
DbConn getDbSession() { if (db == null) { db = createFactory(); } try { return db.getConn(); } catch (Exception e) { jqmlogger.error("Could not create database session.", e); throw new JqmClientException("Could not create database session", e); } }
/** * Create the query cache (with db-specific queries) */ private void initQueries() { DbConn cnx = getConn(); adapter.prepare(p, cnx._cnx); cnx.close(); }
private void checkSchemaVersion() DbConn cnx = this.getConn(); int db_schema_version = 0; int db_schema_compat_version = 0;
private void checkSchemaVersion() DbConn cnx = this.getConn(); int db_schema_version = 0; int db_schema_compat_version = 0;
ds.setDatabase("jdbc:hsqldb:mem:" + s.getDatabaseName(0, true)); db = new Db(ds, true); cnx = db.getConn();
ds.setDatabase("jdbc:hsqldb:mem:" + s.getDatabaseName(0, true)); db = new Db(ds, true); cnx = db.getConn();
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 }