## org.eclipse.datatools.sqltools.core.services
Class ExecutionService

    java.lang.Object
      org.eclipse.datatools.sqltools.core.services.ExecutionService

public class ExecutionService
extends java.lang.Object

A SQL execution service specific to a database definition.

Author:
  Hui Cao

Field Summary
`static java.lang.String` `KEY_PROMPT_VAR`
`static java.lang.String` `KEY_VAR_DECLARATION`

Constructor Summary
`ExecutionService()`

Method Summary
`java.lang.Runnable` `createAdHocScriptRunnable(java.sql.Connection con, java.lang.String sql, boolean closeCon, IConnectionTracker tracker, IProgressMonitor parentMonitor, DatabaseIdentifier databaseIdentifier, ILaunchConfiguration configuration, java.util.HashMap addInfo)` Returns a `Runnable` object capable of running ad hoc sql statements.
`java.lang.Runnable` `createCallableSQLResultRunnable(java.sql.Connection con, ILaunchConfiguration configuration, boolean closeCon, IConnectionTracker tracker, DatabaseIdentifier databaseIdentifier)` Deprecated. for backward compatibility. Use createAdHocScriptRunnable instead
`java.lang.Runnable` `createExecuteParallelRunnable(java.lang.String sql, DatabaseIdentifier databaseIdentifier)` The returned thread will be started together with the SQL execution logic.
`java.lang.Runnable` `createFunctionRunnable(java.sql.Connection con, java.lang.String sql, boolean closeCon, IConnectionTracker tracker, IProgressMonitor parentMonitor, DatabaseIdentifier databaseIdentifier, ILaunchConfiguration configuration, java.util.HashMap addInfo)` Returns a `Runnable` object capable of running a UDF.
`java.lang.Runnable` `createSimpleSQLResultRunnable(java.sql.Connection con, java.lang.String sql, boolean closeCon, IConnectionTracker tracker, IProgressMonitor parentMonitor, DatabaseIdentifier databaseIdentifier, ILaunchConfiguration configuration, java.util.HashMap addInfo)` Deprecated. for backward compatibility. Use createAdHocScriptRunnable instead
`java.lang.Runnable` `createStoredProcedureRunnable(java.sql.Connection con, ILaunchConfiguration configuration, boolean closeCon, IConnectionTracker tracker, DatabaseIdentifier databaseIdentifier)` Returns a `Runnable` object capable of running a stored procedure.
`java.lang.String` `getCallableStatementPrefix(int type)` Returns a String prefix for invoking Routine/Event with the specified type in a CalllableStatement.
`java.lang.String` `getDirectInvocationPrefix(int type)` Returns the prefix used to construct a sql statement to directly invoke a procedural object.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### KEY_PROMPT_VAR

    public static final java.lang.String KEY_PROMPT_VAR

See Also:
  Constant Field Values

### KEY_VAR_DECLARATION

    public static final java.lang.String KEY_VAR_DECLARATION

See Also:
  Constant Field Values

Constructor Detail

### ExecutionService

    public ExecutionService()

Method Detail

### createStoredProcedureRunnable

    public java.lang.Runnable createStoredProcedureRunnable(java.sql.Connection con,
                                                            ILaunchConfiguration configuration,
                                                            boolean closeCon,
                                                            IConnectionTracker tracker,
                                                            DatabaseIdentifier databaseIdentifier)

  Returns a `Runnable` object capable of running a stored procedure. Might be null.

  Parameters:
    `con` - the connection
    `configuration` - the lauch configuration
    `closeCon` - whether should close connection
    `tracker` - if closeCon is true and tracker is not null, will notify it when close the connection
    `databaseIdentifier` -
  See Also:
    `CallableSQLResultRunnable`

### createFunctionRunnable

    public java.lang.Runnable createFunctionRunnable(java.sql.Connection con,
                                                     java.lang.String sql,
                                                     boolean closeCon,
                                                     IConnectionTracker tracker,
                                                     IProgressMonitor parentMonitor,
                                                     DatabaseIdentifier databaseIdentifier,
                                                     ILaunchConfiguration configuration,
                                                     java.util.HashMap addInfo)

  Returns a `Runnable` object capable of running a UDF. Might be null.

  Parameters:
    `con` - the connection
    `sql` - the statement to be executed
    `closeCon` - whether should close connection
    `tracker` - if closeCon is true and tracker is not null, will notify it when close the connection
    `parentMonitor` -
    `databaseIdentifier` -
    `configuration` - the lauch configuration
    `addInfo` - vendor specific options
  See Also:
    `ResultSupportRunnable`

### createAdHocScriptRunnable

    public java.lang.Runnable createAdHocScriptRunnable(java.sql.Connection con,
                                                        java.lang.String sql,
                                                        boolean closeCon,
                                                        IConnectionTracker tracker,
                                                        IProgressMonitor parentMonitor,
                                                        DatabaseIdentifier databaseIdentifier,
                                                        ILaunchConfiguration configuration,
                                                        java.util.HashMap addInfo)

  Returns a `Runnable` object capable of running ad hoc sql statements. Might be null.

  Parameters:
    `con` - the connection
    `sql` - the statement to be executed
    `closeCon` - whether should close connection
    `tracker` - if closeCon is true and tracker is not null, will notify it when close the connection
    `parentMonitor` -
    `databaseIdentifier` -
    `configuration` - the lauch configuration
    `addInfo` - vendor specific options
  See Also:
    `ResultSupportRunnable`

### createSimpleSQLResultRunnable

    public java.lang.Runnable createSimpleSQLResultRunnable(java.sql.Connection con,
                                                            java.lang.String sql,
                                                            boolean closeCon,
                                                            IConnectionTracker tracker,
                                                            IProgressMonitor parentMonitor,
                                                            DatabaseIdentifier databaseIdentifier,
                                                            ILaunchConfiguration configuration,
                                                            java.util.HashMap addInfo)

  Deprecated. for backward compatibility. Use createAdHocScriptRunnable instead

  Returns a `Runnable` object capable of running sql statements. Might be null.

  Parameters:
    `con` - the connection
    `sql` - the statement to be executed
    `closeCon` - whether should close connection
    `tracker` - if closeCon is true and tracker is not null, will notify it when close the connection
    `parentMonitor` -
    `databaseIdentifier` -
    `configuration` - the lauch configuration
    `addInfo` - vendor specific options
  See Also:
    `ResultSupportRunnable`

### createCallableSQLResultRunnable

    public java.lang.Runnable createCallableSQLResultRunnable(java.sql.Connection con,
                                                              ILaunchConfiguration configuration,
                                                              boolean closeCon,
                                                              IConnectionTracker tracker,
                                                              DatabaseIdentifier databaseIdentifier)

  Deprecated. for backward compatibility. Use createAdHocScriptRunnable instead

  Returns a `Runnable` object capable of running CallableStatement. Might be null.

  Parameters:
    `con` - the connection
    `configuration` - the lauch configuration
    `closeCon` - whether should close connection
    `tracker` - if closeCon is true and tracker is not null, will notify it when close the connection
    `databaseIdentifier` -

### createExecuteParallelRunnable

    public java.lang.Runnable createExecuteParallelRunnable(java.lang.String sql,
                                                            DatabaseIdentifier databaseIdentifier)

  The returned thread will be started together with the SQL execution logic. A typical usage of this method is to retrieve query plan while executing the sql statement.

  Returns:

### getCallableStatementPrefix

    public java.lang.String getCallableStatementPrefix(int type)

  Returns a String prefix for invoking Routine/Event with the specified type in a CalllableStatement.

  Returns:
    SQL construct that can invoke Routine/Event with the specified type

### getDirectInvocationPrefix

    public java.lang.String getDirectInvocationPrefix(int type)

  Returns the prefix used to construct a sql statement to directly invoke a procedural object.

  Returns:
    "exec ", "call ", "TRIGGER EVENT " or "" based on type

Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.