/** * Returns the Action service * */ public ActionService getActionService() { return new ActionService(); }
/** * Returns the SQL data service associated with this database definition * */ public SQLDataService getSQLDataService() { return new SQLDataService(); }
/** * Returns the connection service associated with this database definition * */ public ConnectionService getConnectionService() { return new ConnectionService(); }
/** * Returns a connection for caller to use. By default there's no connection pool associated with a connection * profile and this method just ignore the usePool parameter and delegates to {@link #createConnection(String, String)}. * Vendors who has the requirement to use connection pool may override this method. * @param databaseIdentifier the database identifier * @param usePool whether to retrieve the connection from connection pool. * @return a <code>Connection</code> instance * @throws SQLException if database error occurs */ public Connection createConnection(DatabaseIdentifier databaseIdentifier, boolean usePool) throws SQLException, NoSuchProfileException { return createConnection(databaseIdentifier.getProfileName(), databaseIdentifier.getDBname()); } /**
protected void initConnection(Connection connection) { //obtain the killer before execution to ensure we can get the connection id _connKiller = SQLToolsFacade.getConfiguration(null, _databaseIdentifier).getConnectionService().getConnectionKiller(_databaseIdentifier, connection); if (_needsInitConnection) { //MUST initialize this connection after getting the connection killer. IConnectionInitializer init = SQLToolsFacade.getConfiguration(null, _databaseIdentifier).getConnectionService().getConnectionInitializer(); if (init != null) { //if the configuration is null, will use the default options to initialize init.init(_databaseIdentifier, connection, getConfiguration()); } } }
public static boolean showAction(String dbType, String actionId) { SQLDevToolsConfiguration f = null; f = getConfigurationByDBDefName(dbType); if (f != null) { return f.getActionService().supportsAction(actionId); } return false; }
public static Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier, Connection conn) { ConnectionService service = getConnectionService(databaseIdentifier); if (service != null) { return service.getConnectionKiller(databaseIdentifier, conn); } return null; }
public static IConnectionInitializer getConnectionInitializer(DatabaseIdentifier databaseIdentifier) { ConnectionService service = getConnectionService(databaseIdentifier); if (service != null) { return service.getConnectionInitializer(); } return null; }
/** * Return a specific GenericSQLContextType object which identifies the context type of templates used in SQL editor. * * @param dbType * @return */ public static GenericSQLContextType getSQLContextType(String dbType) { SQLService service = getSQLService(null, dbType); if (service != null) { return service.getSQLContextType(); } return null; }
/** * Return a special SQLDataValidator to verify user's input value * * @param profileName * @return */ public static ISqlDataValidator getSQLDataValidator(DatabaseIdentifier databaseIdentifier) { SQLDataService s = getSQLDataService(databaseIdentifier, null); if (s != null) { return s.getSQLDataValidator(databaseIdentifier); } return null; }
/** * * Return an ISQLSyntax object which can be used to highlight sql statements in SQL editor. * * @param dbType * @return */ public static ISQLSyntax getSQLSyntax(String dbType) { SQLService s = getSQLService(null, dbType); if (s != null) { return s.getSQLSyntax(); } return null; }
/** * Return a SQLParser which is used to parse database dialect * * @param profileName * @param dbType * @return */ public static SQLParser getSQLParser(String profileName, String dbType) { SQLService s = getSQLService(new DatabaseIdentifier(profileName), dbType); if (s != null) { return s.getSQLParser(); } return null; }
DatabaseIdentifier databaseIdentifier, ILaunchConfiguration configuration, HashMap addInfo) { return createSimpleSQLResultRunnable(con, sql, closeCon, tracker, parentMonitor,
/** * Returns the SQL service associated with this database definition */ public SQLService getSQLService() { return new SQLService(); }
/** * Returns the SQL Editor service associated with this database definition * */ public SQLEditorService getSQLEditorService() { return new SQLEditorService(); }
/** * Returns the SQL execution service associated with this database definition * */ public ExecutionService getExecutionService() { return new ExecutionService(); }
/** * Returns the SQL execution service associated with this database definition * */ public UIComponentService getUIComponentService() { return new UIComponentService(); }
/** * Returns a <code>Runnable</code> object capable of running a stored procedure. Might be null. * @param con the connection * @param configuration the lauch configuration * @param closeCon whether should close connection * @param tracker if closeCon is true and tracker is not null, will notify it when close the connection * @param databaseIdentifier * @see org.eclipse.datatools.sqltools.routineeditor.result.CallableSQLResultRunnable */ public Runnable createStoredProcedureRunnable(Connection con, ILaunchConfiguration configuration, boolean closeCon, IConnectionTracker tracker, DatabaseIdentifier databaseIdentifier) { return createCallableSQLResultRunnable(con, configuration, closeCon, tracker, databaseIdentifier); }
public Connection createConnection(String[] connId) throws SQLException, CoreException, NoSuchProfileException { // using connection pool for debugging may produce unexpected results SQLDevToolsConfiguration f = SQLToolsFacade .getConfigurationByProfileName(getDatabaseIdentifier() .getProfileName()); ConnectionService conService = f.getConnectionService(); Connection con = conService.createConnection(getDatabaseIdentifier() .getProfileName(), getDatabaseIdentifier().getDBname()); if (connId != null && connId.length == 1) { connId[0] = "0"; } return con; }
DatabaseIdentifier databaseIdentifier, ILaunchConfiguration configuration, HashMap addInfo) { return createSimpleSQLResultRunnable(con, sql, closeCon, tracker, parentMonitor,