public Object getAdapter(Class adapter) { if (adapter == ProcIdentifier.class) { return this._procIdentifier; } else if (adapter == IConnectionProfile.class) { try { return ProfileUtil.getProfile(_procIdentifier.getProfileName()); } catch (NoSuchProfileException e) { return null; } } return null; }
/** * Get the ActionService by SQLObject * * @param object the sql model * @return the UIComponentService */ public static ActionService getActionService(SQLObject object) { ProcIdentifier procIdentifier = SQLDevToolsUtil.getProcIdentifier(object); return getActionService(procIdentifier.getProfileName()); }
if (s.equals(_currentProc.getProfileName())&&_currentProc.getType()==ProcIdentifier.TYPE_SP) if (s.equals(_currentProc.getProfileName())&&_currentProc.getType()==ProcIdentifier.TYPE_UDF) if (s.equals(_currentProc.getProfileName())) if (s.equals(_currentProc.getProfileName()))
public void save(String code) throws SQLException { DDLGenerator ddlg = ProfileUtil.getDatabaseDefinition( _proc.getProfileName()).getDDLGenerator(); if (ddlg != null) { SQLObject[] sqlElements = new SQLObject[] { _routine }; EngineeringOption[] opts = ddlg.getOptions(sqlElements); String[] drop = ddlg .dropSQLObjects( sqlElements, EngineeringOptionID.getOptionValueByID(EngineeringOptionID.GENERATE_QUOTED_IDENTIFIER,opts), true, null); // we alway use "true" instead of // opts[GenericDdlGenerationOptions.GENERATE_FULLY_QUALIFIED_NAME].getBoolean() String[] ddl = new String[2]; ddl[0] = drop[0]; ddl[1] = code; _controlConn.executeDDL(ddl); } }
public String getCode() throws SQLException { String code = ""; DDLGenerator ddlg = ProfileUtil.getDatabaseDefinition( _proc.getProfileName()).getDDLGenerator(); if (ddlg != null) { SQLObject[] sqlElements = new SQLObject[] { _routine }; EngineeringOption[] opts = ddlg.getOptions(sqlElements); boolean quotedId = SQLDevToolsUtil.getQuotedIdentifier(_proc.getDatabaseIdentifier()); EngineeringOptionID.setOptionValueByID(EngineeringOptionID.GENERATE_QUOTED_IDENTIFIER,opts,quotedId); String[] ddl = ddlg.generateDDL(sqlElements, null); if (ddl != null && ddl.length > 0) { code = ddl[0]; } } return code; }
public void drop() throws SQLException { DDLGenerator ddlg = ProfileUtil.getDatabaseDefinition( _proc.getProfileName()).getDDLGenerator(); if (ddlg != null) { SQLObject[] sqlElements = new SQLObject[] { _routine }; EngineeringOption[] opts = ddlg.getOptions(sqlElements); String[] drop = ddlg .dropSQLObjects( sqlElements, SQLDevToolsUtil.isQuotedIdentifierOn(_proc.getDatabaseIdentifier()), true, null); // we alway use "true" instead of // opts[GenericDdlGenerationOptions.GENERATE_FULLY_QUALIFIED_NAME].getBoolean() //controlconnection will refresh and dispose this object _controlConn.executeDDL(drop); } }
public static void saveEvent(ILaunchConfigurationWorkingCopy configuration, ProcIdentifier proc, Map eventparams, String sql) { configuration.setAttribute(ROUTINE_LAUNCH_PROFILENAME, proc == null ? "" : proc.getProfileName()); configuration.setAttribute(ROUTINE_LAUNCH_DATABASENAME, proc == null ? "" : proc.getDatabaseIdentifier().getDBname()); configuration.setAttribute(ROUTINE_LAUNCH_PROCID, proc == null ? "" : proc.encode()); configuration.setAttribute(ROUTINE_LAUNCH_TYPE, 0); configuration.setAttribute(ROUTINE_LAUNCH_SQL, sql); saveEventParameter(configuration, eventparams); }
profile = ProfileUtil.getProfile(((ProcIdentifier)source).getProfileName()); } catch (NoSuchProfileException e) {
/** * */ public ProcEditorInput(ProcIdentifier procid) { super(procid.getDisplayString(), ""); this._procIdentifier = procid; String code = ""; try { IControlConnection controlConnection = EditorCorePlugin.getControlConnectionManager().getOrCreateControlConnection(procid.getDatabaseIdentifier()); code = controlConnection.getProcSource(procid); } catch(Exception e) { RoutineEditorActivator.getDefault().log(e); } setStorage(new SQLEditorStorage(_procIdentifier.getDisplayString(), code)); setConnectionInfo(new SQLEditorConnectionInfo(ProfileUtil.getDatabaseVendorDefinitionId(procid.getProfileName()), procid.getProfileName(), procid.getDatabaseName(), procid.getOwnerName())); }
public static void saveSPUDF(ILaunchConfigurationWorkingCopy configuration, ProcIdentifier proc, List parameters, String sql) { configuration.setAttribute(ROUTINE_LAUNCH_PROFILENAME, proc == null ? "" : proc.getProfileName()); configuration.setAttribute(ROUTINE_LAUNCH_DATABASENAME, proc == null ? "" : proc.getDatabaseIdentifier().getDBname()); configuration.setAttribute(ROUTINE_LAUNCH_PROCID, proc == null ? "" : proc.encode()); configuration.setAttribute(ROUTINE_LAUNCH_TYPE, 0); configuration.setAttribute(ROUTINE_LAUNCH_SQL, sql); saveParameterList(configuration, parameters); setConnectionLevelOptions(configuration); }
if (oldName.equals(prodId.getProfileName())) { prodId.getDatabaseIdentifier().setProfileName(newName); if (editorPart instanceof SQLEditor) {