public ImportDatabaseTableCommand(String id, String model, String revisedId, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName) { super(id, model, revisedId); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; }
prefObject.put(JsonKeys.dbType.name(), dbType.name()); prefObject.put(JsonKeys.hostname.name(), hostname); prefObject.put(JsonKeys.portnumber.name(), portnumber);
@Override public UpdateContainer doIt(Workspace workspace) throws CommandException { setRequestedInteractionType(InteractionType.importTable); UpdateContainer c = super.doIt(workspace); try { // Create a new Database Import Command. The interface allows the user to import // multiple tables ImportDatabaseTableCommand comm = new ImportDatabaseTableCommand(workspace.getFactory().getNewId("C"), model, dbType.name(), hostname, portnumber, username, password, dBorSIDName); workspace.getCommandHistory().addPreviewCommand(comm); NewDatabaseCommandUpdate upd = new NewDatabaseCommandUpdate(comm.getId()); c.add(upd); } catch (Throwable e) { String message = e.getMessage().replaceAll("\n", "").replaceAll("\"", "\\\""); ErrorUpdate errUpdt = new ErrorUpdate(message); c.add(errUpdt); } return c; }
public ImportSQLCommand(String id, String model, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName, String query) { super(id, model); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; this.query = query; }
@Override public UpdateContainer doIt(Workspace workspace) throws CommandException { setRequestedInteractionType(InteractionType.importSQL); UpdateContainer c = super.doIt(workspace); try { // Create a new Database Import Command. The interface allows the user to import // multiple tables ImportSQLCommand comm = new ImportSQLCommand(workspace.getFactory().getNewId("C"), model, dbType.name(), hostname, portnumber, username, password, dBorSIDName, query); workspace.getCommandHistory().addPreviewCommand(comm); c.add(new InfoUpdate("Sucessfully imported data using SQL")); c.add(new SQLCommandUpdate(comm.getId())); } catch (Throwable e) { String message = e.getMessage().replaceAll("\n", "").replaceAll("\"", "\\\""); ErrorUpdate errUpdt = new ErrorUpdate(message); c.add(errUpdt); } return c; }
public ImportSQLCommand(String id, String model, String revisedId, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName, String query) { super(id, model, revisedId); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; this.query = query; }
srcInfo.setAttributeValue(InfoAttribute.dbType, dbType.name()); srcInfo.setAttributeValue(InfoAttribute.hostname, hostname); srcInfo.setAttributeValue(InfoAttribute.portnumber, String.valueOf(portnumber));
public ImportDatabaseTableCommand(String id, String model, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName) { super(id, model); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; }
srcInfo.setAttributeValue(InfoAttribute.dbType, dbType.name()); srcInfo.setAttributeValue(InfoAttribute.hostname, hostname); srcInfo.setAttributeValue(InfoAttribute.portnumber, String.valueOf(portnumber));
dbType = DBType.valueOf(dbtypeStr); if (dbType == null) { logger.error("Unidentified database type. Valid values: "
dbType = DBType.valueOf(request.getParameter("dBType")); hostname = request.getParameter("hostname"); username = request.getParameter("username");
switch (type) { case generateTableList: { dbType = DBType.valueOf(request.getParameter("dBType")); hostname = request.getParameter("hostname"); username = request.getParameter("username");