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; }
srcInfo.setAttributeValue(InfoAttribute.dbType, dbType.name()); srcInfo.setAttributeValue(InfoAttribute.hostname, hostname); srcInfo.setAttributeValue(InfoAttribute.portnumber, String.valueOf(portnumber));
@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; }
srcInfo.setAttributeValue(InfoAttribute.dbType, dbType.name()); srcInfo.setAttributeValue(InfoAttribute.hostname, hostname); srcInfo.setAttributeValue(InfoAttribute.portnumber, String.valueOf(portnumber));