org.eclipse.datatools.sqltools.sql.util
Class ParameterUtil

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sql.util.ParameterUtil

public class ParameterUtil
extends java.lang.Object

Author:
Hui Cao

Constructor Summary
ParameterUtil()
           
 
Method Summary
static org.eclipse.datatools.sqltools.core.dbitem.ParameterDescriptor[] getParameterDescriptors(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier, java.sql.Connection connection, int type, org.eclipse.datatools.sqltools.core.ProcIdentifier proc)
          Returns the ParameterDescriptors of a procedural object.
static java.util.Map getSPParamDefaultValues(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier, java.lang.String sp)
          Parse the given sp definition and returns the parameter name/default value pairs.
static java.util.HashMap getSPParams(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier, java.lang.String sp)
          Parse the given sp definition and returns the parameter name/IASTSQLParam pairs.
static java.util.Map getSPParamTypeNameMapFromParser(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier, java.lang.String sp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterUtil

public ParameterUtil()
Method Detail

getSPParamDefaultValues

public static java.util.Map getSPParamDefaultValues(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier,
                                                    java.lang.String sp)
Parse the given sp definition and returns the parameter name/default value pairs.

Parameters:
profileName - used to determine the db type
sp - the sp definition
Returns:

getSPParamTypeNameMapFromParser

public static java.util.Map getSPParamTypeNameMapFromParser(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier,
                                                            java.lang.String sp)

getSPParams

public static java.util.HashMap getSPParams(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier,
                                            java.lang.String sp)
Parse the given sp definition and returns the parameter name/IASTSQLParam pairs.

Parameters:
databaseIdentifier - used to determine the db type
sp - the sp definition
Returns:

getParameterDescriptors

public static org.eclipse.datatools.sqltools.core.dbitem.ParameterDescriptor[] getParameterDescriptors(org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier,
                                                                                                       java.sql.Connection connection,
                                                                                                       int type,
                                                                                                       org.eclipse.datatools.sqltools.core.ProcIdentifier proc)
                                                                                                throws java.sql.SQLException
Returns the ParameterDescriptors of a procedural object. Although we can get ParameterMode from catalog loader, its limited parameter type ( compared with JDBC ) and lack of nullablity and default value support force us to use this JDBC approach.

Parameters:
con -
type -
runstring -
Returns:
@throws SQLException
Throws:
java.sql.SQLException