/** * @see stream.AbstractProcessor#init(stream.ProcessContext) */ @Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); if (table == null || table.trim().equals("")) throw new Exception("No 'table' attribute provided!"); init(); log.debug("init(ProcessContext) done."); }
init(); } catch (Exception e) { throw new ProcessorException(this, "Failed to initialize database connection: " + e.getMessage()); log.debug("No table-schema found, does table exist? {}", this.hasTable(getTable())); tableSchema = dialect.getTableSchema(connection, getTable()); log.debug("Tried to read schema from database: {}", tableSchema); log.debug("Creating new table {} from first item {}", getTable(), input); Data sample = DataFactory.create(); if (createTable(getTable(), schema)) { tableSchema = schema; } else { throw new ProcessorException(this, "Failed to create table " + getTable() + " for item: " + input); if (!hasTable(getTable())) { if (!this.createTable(getTable(), tableSchema)) { throw new ProcessorException(this, "Failed to create table '" + getTable() + "'!"); } else { this.tableExists = true; insert.append(getTable()); insert.append(" ( ");
private void init() throws Exception { connection = openConnection(); log.debug("Opened connection to {} = {}", getUrl(), connection); log.debug("Dialect = {} ", dialect); log.debug("Dropping existing table '{}'", getTable()); int ret = stmt.executeUpdate("DROP TABLE " + getTable()); log.debug("Return of DROP TABLE: {}", ret); } catch (Exception e) { Map<String, Class<?>> schema = dialect.getTableSchema(connection, getTable()); if (schema != null) { log.debug("Using existing table schema: {}", schema);
init(); } catch (Exception e) { throw new ProcessorException(this, "Failed to initialize database connection: " + e.getMessage()); log.debug("No table-schema found, does table exist? {}", this.hasTable(getTable())); tableSchema = dialect.getTableSchema(connection, getTable()); log.debug("Tried to read schema from database: {}", tableSchema); log.debug("Creating new table {} from first item {}", getTable(), input); Data sample = DataFactory.create(); if (createTable(getTable(), schema)) { tableSchema = schema; } else { throw new ProcessorException(this, "Failed to create table " + getTable() + " for item: " + input); if (!hasTable(getTable())) { if (!this.createTable(getTable(), tableSchema)) { throw new ProcessorException(this, "Failed to create table '" + getTable() + "'!"); } else { this.tableExists = true; insert.append(getTable()); insert.append(" ( ");
private void init() throws Exception { connection = openConnection(); log.debug("Opened connection to {} = {}", getUrl(), connection); log.debug("Dialect = {} ", dialect); log.debug("Dropping existing table '{}'", getTable()); int ret = stmt.executeUpdate("DROP TABLE " + getTable()); log.debug("Return of DROP TABLE: {}", ret); } catch (Exception e) { getTable()); if (schema != null) { log.debug("Using existing table schema: {}", schema);
init(); } catch (Exception e) { throw new ProcessorException(this, this.hasTable(getTable())); tableSchema = dialect.getTableSchema(connection, getTable()); log.debug("Tried to read schema from database: {}", tableSchema); getTable(), input); Data sample = DataFactory.create(); if (keys != null) { if (createTable(getTable(), schema)) { tableSchema = schema; } else { throw new ProcessorException(this, "Failed to create table " + getTable() + " for item: " + input); if (!hasTable(getTable())) { if (!this.createTable(getTable(), tableSchema)) { throw new ProcessorException(this, "Failed to create table '" + getTable() + "'!"); } else { this.tableExists = true; insert.append(getTable());
private void init() throws Exception { connection = openConnection(); log.debug("Opened connection to {} = {}", getUrl(), connection); log.debug("Dialect = {} ", dialect); log.debug("Dropping existing table '{}'", getTable()); int ret = stmt.executeUpdate("DROP TABLE " + getTable()); log.debug("Return of DROP TABLE: {}", ret); } catch (Exception e) { Map<String, Class<?>> schema = dialect.getTableSchema(connection, getTable()); if (schema != null) { log.debug("Using existing table schema: {}", schema);
/** * @see stream.AbstractProcessor#init(stream.ProcessContext) */ @Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); if (table == null || table.trim().equals("")) throw new Exception("No 'table' attribute provided!"); init(); log.debug("init(ProcessContext) done."); }
/** * @see stream.AbstractProcessor#init(stream.ProcessContext) */ @Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); if (table == null || table.trim().equals("")) throw new Exception("No 'table' attribute provided!"); init(); log.debug("init(ProcessContext) done."); }