All Packages    This Package  Previous  Next  

Class sqlj.runtime.profile.EntryInfo

java.lang.Object
   |
   +----sqlj.runtime.profile.EntryInfo

public abstract class EntryInfo
extends Object
implements Serializable, ObjectInputValidation
A profile EntryInfo object contains the constant information describing a static sql operation constructed at translation time, including the sql string in JDBC format, the return type of the operation, the types of each bind parameter, and the way in which the operation is to be executed at runtime.


Variable Index

 o BLOCK
Constant returned by getRole indicating that the operation is a BEGIN..END block.
 o CALL
Constant returned by getRole indicating the operation is a call to a stored procedure.
 o CALLABLE_STATEMENT
Constant returned by getStatementType indicating that the runtime statements associated with this entry may include out-parameters (and calls to getXXX methods).
 o COMMIT
Constant returned by getRole indicating that the operation is a COMMIT statement.
 o EXECUTE
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the execute() method.
 o EXECUTE_QUERY
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the executeRTQuery() method.
 o EXECUTE_UPDATE
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the executeUpdate() method.
 o NAMED_RESULT
Constant returned by getResultSetType indicating that this entry produces a result set whose columns will be bound by name to the columns in this operation.
 o NO_RESULT
Constant returned by getResultSetType indicating that this entry does not produce a result set.
 o OTHER
Constant returned by getRole indicating that the operation cannot be categorized by any of the other constant roles returned by getRole.
 o POSITIONED
Constant returned by getRole indicating that the operation contains a "WHERE CURRENT OF" clause (positioned update or delete, for example).
 o POSITIONED_RESULT
Constant returned by getResultSetType indicating that this entry produces a result set whose columns will be bound by position to the columns in this operation.
 o PREPARED_STATEMENT
Constant returned by getStatementType indicating that the runtime statements associated with this entry do not have any out-parameters.
 o QUERY
Constant returned by getRole indicating the operation is a SELECT statement.
 o QUERY_FOR_UPDATE
Constant returned by getRole indicating that the operation produces a result set which will later be used in a positioned update.
 o ROLLBACK
Constant returned by getRole indicating that the operation is a ROLLBACK statement.
 o SET_TRANSACTION
Constant returned by getRole indicating that the operation is a SET TRANSACTION statement.
 o SINGLE_ROW_QUERY
Constant returned by getRole indicating that the operation produces a result set which is expected to contain a single row.
 o STATEMENT
Constant returned by getRole indicating the operation is a general SQL statement not categorized by other roles (e.g., DML, DDL, etc).
 o VALUES
Constant returned by getRole indicating the operation is a call to a stored function.

Constructor Index

 o EntryInfo()

Method Index

 o executeTypeToString(int)
Returns a string representation of an execute type constant.
 o getDescriptor()
Returns an object which describes any additional information particular to this entry.
 o getExecuteType()
Describes the way in which the all executable statement objects associated with this entry will be executed at runtime.
 o getLineNumber()
Returns the starting line number of the operation represented by this entry.
 o getParamCount()
 o getParamInfo(int)
 o getResultSetCount()
Returns the number of columns in the result set produced by this entry, which is always non-negative.
 o getResultSetInfo(int)
Returns a description of the result set column at index "ndx".
 o getResultSetName()
Returns the name of the Java Class associated with the strongly typed result set populated by this entry.
 o getResultSetType()
Describes the type of result set that is produced by this operation, if any.
 o getRole()
Returns the role of the operation to be executed.
 o getSQLString()
Returns the text of the operation to be performed in JDBC format.
 o getStatementType()
Describes the type of statement.
 o getTransactionDescriptor()
If this entry is a SET TRANSACTION statement, a descriptor is returned that contains the access mode and isolation level of the statement.
 o isDefinedRole(int)
Returns true if the passed int parameter represents a defined role, false otherwise.
 o isValidDescriptor(Object, int)
Returns true if the passed descriptor is of valid type (and value) for an entry which has the given role, false otherwise.
 o isValidExecuteType(int)
Returns true if the passed int parameter represents a valid execute type, false otherwise.
 o isValidResultSetType(int)
Returns true if the passed int parameter represents a valid result set type, false otherwise.
 o isValidRole(int)
Returns true if the passed int parameter represents a valid role, false otherwise.
 o isValidStatementType(int)
Returns true if the passed int parameter represents a valid statement type, false otherwise.
 o resultSetTypeToString(int)
Returns a string representation of a result set type constant.
 o roleToString(int)
Returns a string representation of a role constant.
 o statementTypeToString(int)
Returns a string representation of a statement type constant.
 o validateObject()
Performs validation on the internal state of this entry info object.

Variables

 o PREPARED_STATEMENT
 public static final int PREPARED_STATEMENT
Constant returned by getStatementType indicating that the runtime statements associated with this entry do not have any out-parameters. The runtime statements associated with this entry will not expect any getXXX calls to be made.

See Also:
getStatementType
 o CALLABLE_STATEMENT
 public static final int CALLABLE_STATEMENT
Constant returned by getStatementType indicating that the runtime statements associated with this entry may include out-parameters (and calls to getXXX methods).

See Also:
getStatementType
 o EXECUTE_UPDATE
 public static final int EXECUTE_UPDATE
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the executeUpdate() method. Such statements return no result set, and thus have no result set info in this entry.

See Also:
executeUpdate, getExecuteType
 o EXECUTE_QUERY
 public static final int EXECUTE_QUERY
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the executeRTQuery() method. Such statements always return a result set which is described by the getResultSetInfo method of this entry.

See Also:
executeRTQuery, getResultSetInfo, getExecuteType
 o EXECUTE
 public static final int EXECUTE
Constant returned by getExecuteType indicating that the runtime statements associated with this entry will be executed via the execute() method. This constant is used only when the runtime will dynamically determine whether or not an operation returns a result set. An entry of this type is expected to be rare since most static SQL environments should be able to deduce whether an operation will return a result set or not.

See Also:
execute, getExecuteType
 o QUERY
 public static final int QUERY
Constant returned by getRole indicating the operation is a SELECT statement.

See Also:
getRole
 o STATEMENT
 public static final int STATEMENT
Constant returned by getRole indicating the operation is a general SQL statement not categorized by other roles (e.g., DML, DDL, etc).

See Also:
getRole
 o CALL
 public static final int CALL
Constant returned by getRole indicating the operation is a call to a stored procedure.

See Also:
getRole
 o VALUES
 public static final int VALUES
Constant returned by getRole indicating the operation is a call to a stored function.

See Also:
getRole
 o POSITIONED
 public static final int POSITIONED
Constant returned by getRole indicating that the operation contains a "WHERE CURRENT OF" clause (positioned update or delete, for example).

See Also:
getRole
 o QUERY_FOR_UPDATE
 public static final int QUERY_FOR_UPDATE
Constant returned by getRole indicating that the operation produces a result set which will later be used in a positioned update.

See Also:
getRole
 o SINGLE_ROW_QUERY
 public static final int SINGLE_ROW_QUERY
Constant returned by getRole indicating that the operation produces a result set which is expected to contain a single row.

See Also:
getRole
 o BLOCK
 public static final int BLOCK
Constant returned by getRole indicating that the operation is a BEGIN..END block.

See Also:
getRole
 o COMMIT
 public static final int COMMIT
Constant returned by getRole indicating that the operation is a COMMIT statement.

See Also:
getRole
 o ROLLBACK
 public static final int ROLLBACK
Constant returned by getRole indicating that the operation is a ROLLBACK statement.

See Also:
getRole
 o SET_TRANSACTION
 public static final int SET_TRANSACTION
Constant returned by getRole indicating that the operation is a SET TRANSACTION statement. For such an entry, the getDescriptor method returns a SetTransactionDescriptor that further describes the transaction access mode and isolation level.

See Also:
getRole, getDescriptor, SetTransactionDescriptor
 o OTHER
 public static final int OTHER
Constant returned by getRole indicating that the operation cannot be categorized by any of the other constant roles returned by getRole. The value of this constant also defines the upper limit that future role constants added to the EntryInfo class may obtain. Thus, if additional vendor-specific roles are defined, they should be defined with values larger than that of this constant.

See Also:
getRole
 o NO_RESULT
 public static final int NO_RESULT
Constant returned by getResultSetType indicating that this entry does not produce a result set. If the result type indicates NO_RESULT, then getResultSetInfo will always return null, getResultSetCount will always return 0, and getExecuteType will always return EXECUTE_UPDATE.

See Also:
getResultSetType, getResultSetInfo, getResultSetCount, getExecuteType
 o NAMED_RESULT
 public static final int NAMED_RESULT
Constant returned by getResultSetType indicating that this entry produces a result set whose columns will be bound by name to the columns in this operation. If the result type indicates NAMED_RESULT, then getResultSetInfo returns a type info object whose getName method reflects the name of the column expected, and getExecuteType will always return EXECUTE_QUERY.

See Also:
getResultSetType, getResultSetInfo, getExecuteType
 o POSITIONED_RESULT
 public static final int POSITIONED_RESULT
Constant returned by getResultSetType indicating that this entry produces a result set whose columns will be bound by position to the columns in this operation. If the result type indicates POSITIONED_RESULT, then getResultSetInfo for a particular index returns a type info object describing the column type expected at that index in this operation, and getExecuteType will always return EXECUTE_QUERY.

See Also:
getResultSetType, getResultSetInfo, getExecuteType

Constructors

 o EntryInfo
 public EntryInfo()

Methods

 o getSQLString
 public abstract String getSQLString()
Returns the text of the operation to be performed in JDBC format. All host variables have been replaced with '?'. Any INTO-lists have been removed. A positional update will include a clause of the form "WHERE CURRENT OF ?". Comments and hints are preserved as they appeared in the original source file. Function and procedure calls are in the JDBC-prescribed format: { call proc(?) }, and { ? = call fn(?) }.

Returns:
the text of the operation to be performed, in jdbc format.
 o getStatementType
 public abstract int getStatementType()
Describes the type of statement. The value returned will be one of the following constants.

 o isValidStatementType
 public static boolean isValidStatementType(int statementType)
Returns true if the passed int parameter represents a valid statement type, false otherwise. Valid statement type values are those which may be returned by the getStatementType method.

See Also:
getStatementType
 o statementTypeToString
 public static String statementTypeToString(int type)
Returns a string representation of a statement type constant. If the value passed is not a valid statement type, a string representation of the value as an int is returned. This method is most often used in debugging profile entry representations.

See Also:
getStatementType, isValidStatementType
 o getExecuteType
 public abstract int getExecuteType()
Describes the way in which the all executable statement objects associated with this entry will be executed at runtime. The value returned will be one of the following constants.

 o isValidExecuteType
 public static boolean isValidExecuteType(int execType)
Returns true if the passed int parameter represents a valid execute type, false otherwise. Valid execute type values are those which may be returned by the getStatementType method.

See Also:
getExecuteType
 o executeTypeToString
 public static String executeTypeToString(int executeType)
Returns a string representation of an execute type constant. If the value passed is not a valid execute type, a string representation of the value as an int is returned. This method is most often used in debugging profile entry representations.

See Also:
getStatementType
 o getRole
 public abstract int getRole()
Returns the role of the operation to be executed. The role categorizes the operation, and is used to determine how the operation is to be treated at runtime. The value returned may be one of the following constants.

If the role returned is not one of the above constants, it will be a value which is larger than the value of the constant OTHER. Such a result indicates a vendor defined role which may not be reliably processed by all vendors.

Note: regardless of the role, getParameterInfo calls may always be used to describe any parameters for the operation.

 o isDefinedRole
 public static boolean isDefinedRole(int role)
Returns true if the passed int parameter represents a defined role, false otherwise. A defined role is a role which has been defined with a constant field in this class. An enumeration of such constants is found in the getRole method documentation.

See Also:
getRole
 o isValidRole
 public static boolean isValidRole(int role)
Returns true if the passed int parameter represents a valid role, false otherwise. Valid roles values are any roles which are defined, or any values greater than the OTHER constant.

See Also:
getRole, isDefinedRole, OTHER
 o roleToString
 public static String roleToString(int role)
Returns a string representation of a role constant. If the value passed is not a valid role or is a custom role, a string representation of the value as an int is returned. This method is most often used in debugging profile entry representations.

See Also:
getRole, isValidRole
 o getResultSetType
 public abstract int getResultSetType()
Describes the type of result set that is produced by this operation, if any. This method should be used to determine how the results described by getResultSetInfo() are to be interpreted. The value returned will be one of the following constants.

See Also:
getResultSetInfo
 o isValidResultSetType
 public static boolean isValidResultSetType(int resultSetType)
Returns true if the passed int parameter represents a valid result set type, false otherwise. Valid result set type values are those which may be returned by the getResultSetType method.

See Also:
getResultSetType
 o resultSetTypeToString
 public static String resultSetTypeToString(int type)
Returns a string representation of a result set type constant. If the value passed is not a valid result set type, a string representation of the value as an int is returned. This method is most often used in debugging profile entry representations.

See Also:
getResultSetType, isValidResultSetType
 o getResultSetCount
 public abstract int getResultSetCount()
Returns the number of columns in the result set produced by this entry, which is always non-negative. If the operation does not produce a result set or produces a dynamic result set, 0 is returned. Otherwise, getResultSetInfo can be used to determine the type of each result column.

Returns:
the number of columns in the result set produced by this entry, if any.
See Also:
getResultSetInfo, getResultSetType
 o getResultSetInfo
 public abstract TypeInfo getResultSetInfo(int ndx)
Returns a description of the result set column at index "ndx". This may be useful to jdbc implementations which are able to pre-register query result types. The mode of the types described by this method will always be OUT. To determine whether the results will by bound by name or by position, use getResultSetType().

Note that if getResultSetCount returns 0, this method will always return null.

Parameters:
ndx - the index of the result set column to describe, range 1 to getResultSetCount().
Returns:
a description of the result set column at index "ndx", or null if "ndx" out of range.
See Also:
getName, getResultSetType
 o getResultSetName
 public abstract String getResultSetName()
Returns the name of the Java Class associated with the strongly typed result set populated by this entry. If this entry does not populate a strongly typed result set (e.g. resultSetType=NO_RESULT), null is returned.

The getJavaType method of a profile can be used to load the class represented by the result set name using the current profile loader.

Returns:
the name of the Java Class representation of the type.
See Also:
getJavaType, getResultSetType
 o getParamCount
 public abstract int getParamCount()
Returns:
the number of parameters for this entry, 0 or greater.
 o getParamInfo
 public abstract TypeInfo getParamInfo(int ndx)
Parameters:
ndx - the index of the parameter to describe, range 1 to getParamCount().
Returns:
a description of the parameter at index "ndx", or null if "ndx" out of range.
 o getDescriptor
 public abstract Object getDescriptor()
Returns an object which describes any additional information particular to this entry. The object returned will vary according to the role of the sql statement contained in this entry. The following list describes the type of descriptor returned as a function of the role of this entry.

POSITIONED
Returns an Integer whose value is the 1-based index of the CURRENT OF cursor parameter in this entry. For example, if the sql string is UPDATE TAB SET COL1=? WHERE CURRENT OF ?, then 2 would be returned. The index can be passed to getParamInfo to describe the cursor type.
SET_TRANSACTION
Returns a SetTransactionDescriptor that describes the access mode and isolation level of the SET TRANSACTION statement.
All Other Roles
Returns null descriptor.

Returns:
a descriptor object for this entry.
See Also:
getRole, getParamInfo, SetTransactionDescriptor, getTransactionDescriptor
 o getTransactionDescriptor
 public SetTransactionDescriptor getTransactionDescriptor()
If this entry is a SET TRANSACTION statement, a descriptor is returned that contains the access mode and isolation level of the statement. Otherwise, null is returned.

See Also:
SET_TRANSACTION, getDescriptor
 o isValidDescriptor
 public static boolean isValidDescriptor(Object descriptor,
                                         int role)
Returns true if the passed descriptor is of valid type (and value) for an entry which has the given role, false otherwise. The expected descriptor types are defined by the getDescriptor method. Note that in the case of user-defined roles, any descriptor value is permitted.

See Also:
getDescriptor
 o getLineNumber
 public abstract int getLineNumber()
Returns the starting line number of the operation represented by this entry. The location returned is the line in the original source file, as given by the getSourceFile method of the profile data for this entry. Source file lines are numbered starting at 1. If line number information is not available, 0 is returned.

See Also:
getSourceFile
 o validateObject
 public void validateObject() throws InvalidObjectException
Performs validation on the internal state of this entry info object. In particular, the statement type, execute type, role, result set type, and descriptor are validated. An exception is thrown if this type contains invalid state.

To allow for compatibility with future versions, this method is not automatically called during object deserialization. Profile runtime library implementors should call this method as needed at runtime to verify the state of the object. For example, this method could be called from a readObject implementation of an EntryInfo subclass.

It is recommended that subclasses use this method during object construction once state is complete to validate the entry.

See Also:
isValidStatementType, isValidExecuteType, isValidRole, isValidResultSetType, isValidDescriptor

All Packages    This Package  Previous  Next