Class Hierarchy All Classes All Fields and Methods
Interface com.ibm.etools.sqlj.template.IBeanData
public interface IBeanData
Provides access to the information that is collected by the New SQLJ File wizard. This information can be used to customize the code generated for the new SQLJ file.
Field Index Field Description AUTHENTICATION_BY_CALLER Authentication is passed as parameters in generated code. AUTHENTICATION_IN_METHOD Authentication is hard-coded in generated code.
Method Index Method Description int getAuthenticationStyle() Returns a code that signifies how to handle user authentication for database access at run time. String getClassName() Returns the Java class name of the new SQLJ file. String[] getColMethodsNames() Returns unique names to use as method names to retrieve individual column data. ISQLFieldInfo[] getColumnInfo() Returns metadata about the columns that are contained in the SQL statement. String getDataSourceName() Returns the JNDI name of the DataSource object to use to obtain the runtime database connection. String getDriverName() Returns the name of the JDBC driver to use to connect to the database at run time. String getJavaPackageName() Returns the name of the package in which the new SQLJ file should be stored. String getJavaTypeForSql(int) Returns the Java type for the specified SQL type. ISQLFieldInfo[] getParmInfo() Returns the information about the parameters that are contained in the SQL statement. String getPassword() Returns the password to use to access the database at run time. String getSQLStatementString() Returns the SQL statement that was specified in the New SQLJ File wizard. String getURL() Returns the URL of the database to connect to at run time. String getUserName() Returns the user ID to use to access the database at run time. boolean isUseDriverManager() Indicates whether to use a DriverManager object to obtain the run-time database connection.
Fields
AUTHENTICATION_BY_CALLER
public static final int AUTHENTICATION_BY_CALLERAuthentication is passed as parameters in generated code.
AUTHENTICATION_IN_METHOD
public static final int AUTHENTICATION_IN_METHODAuthentication is hard-coded in generated code.
Methods
getAuthenticationStyle
public int getAuthenticationStyle()Returns a code that signifies how to handle user authentication for database access at run time.
- Returns
- the numeric value that corresponds to the radio button selected under How will user authentication be provided on the Specify Runtime Database Connection Information page of the New SQLJ File wizard.
The int value returned is one of the two following authentication styles:
AUTHENTICATION_IN_METHOD - authentication is hardcoded in method
AUTHENTICATION_BY_CALLER - authentication is passed as parameters in method of the calling application
getClassName
public String getClassName()Returns the Java class name of the new SQLJ file.
- Returns
- the value specified in the Name field on the SQLJ File page of the New SQLJ File wizard.
getColMethodsNames
public String[] getColMethodsNames()Returns unique names to use as method names to retrieve individual column data. Adds the column's table name as a prefix to the column name. Removes quotes in the names and replaces blanks with underscores. If the method name is not unique, it appends a number to the end of the string until a unique name is obtained.
- Returns
- array containing unique method names that correspond to the names of the columns in the result set.
getColumnInfo
public ISQLFieldInfo[] getColumnInfo()Returns metadata about the columns that are contained in the SQL statement.
- Returns
- an array of type ISQLFieldInfo that contains column information.
- See Also
getDataSourceName
public String getDataSourceName()Returns the JNDI name of the DataSource object to use to obtain the runtime database connection.
- Returns
- the value specified in the DataSource/JNDI name field on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. If the Use DataSource connection radio button is not selected, the return value is null.
getDriverName
public String getDriverName()Returns the name of the JDBC driver to use to connect to the database at run time.
- Returns
- the value specified in the Driver name field on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. If the Use DriverManager connection radio button is not selected, the return value is null.
getJavaPackageName
public String getJavaPackageName()Returns the name of the package in which the new SQLJ file should be stored.
- Returns
- the value specified in the Package field on the SQLJ File page of the New SQLJ File wizard.
getJavaTypeForSql
public String getJavaTypeForSql(int type)Returns the Java type for the specified SQL type. The SQL type of a column can be obtained from the ISQLFieldInfo.getType() method.
- Parameters
- type - an SQL type as defined in java.sql.Types
- Returns
- the name of the Java type.
- See Also
getParmInfo
public ISQLFieldInfo[] getParmInfo()Returns the information about the parameters that are contained in the SQL statement.
- Returns
- an array of type ISQLFieldInfo that contains parameter information.
- See Also
getPassword
public String getPassword()Returns the password to use to access the database at run time.
- Returns
- the value specified in the Password field on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. If the Variables inside of method radio button is not selected, the return value is null.
getSQLStatementString
public String getSQLStatementString()Returns the SQL statement that was specified in the New SQLJ File wizard. This statement was either selected on the Select an Existing Statement Saved in your Workspace page or constructed using the wizard.
- Returns
- the name of the specified SQL statement.
getURL
public String getURL()Returns the URL of the database to connect to at run time.
- Returns
- the value specified in the URL field on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. If the Use DriverManager connection radio button is not selected, the return value is null.
getUserName
public String getUserName()Returns the user ID to use to access the database at run time.
- Returns
- the value specified in the User ID field on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. If the Variables inside of method radio button is not selected, the return value is null.
isUseDriverManager
public boolean isUseDriverManager()Indicates whether to use a DriverManager object to obtain the run-time database connection.
- Returns
- the state of the Use DriverManager connection radio button on the Specify Runtime Database Connection Information page of the New SQLJ File wizard. The value returned is true if the radio button is selected; otherwise, false.
Class Hierarchy All Classes All Fields and Methods