com.ibm.datatools.sqlj.template
Interface 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 Summary

Field Summary
Data TypeField Name and Description
static int AUTHENTICATION_BY_CALLER
Authentication is passed as parameters in generated code.
static int AUTHENTICATION_IN_METHOD
Authentication is hard-coded in generated code.

Method Summary

Method Summary
Return Data TypeMethod Name and Description
int getAuthenticationStyle()
Returns a code that signifies how to handle user authentication for database access at run time.
java.lang.String getClassName()
Returns the Java class name of the new SQLJ file.
java.lang.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.
java.lang.String getDataSourceName()
Returns the JNDI name of the DataSource object to use to obtain the runtime database connection.
java.lang.String getDriverName()
Returns the name of the JDBC driver to use to connect to the database at run time.
java.lang.String getJavaPackageName()
Returns the name of the package in which the new SQLJ file should be stored.
java.lang.String getJavaTypeForSql(int type)
Returns the Java type for the specified SQL type.
ISQLFieldInfo[] getParmInfo()
Returns the information about the parameters that are contained in the SQL statement.
java.lang.String getPassword()
Returns the password to use to access the database at run time.
java.lang.String getSQLStatementString()
Returns the SQL statement that was specified in the New SQLJ File wizard.
java.lang.String getURL()
Returns the URL of the database to connect to at run time.
java.lang.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.

Field Detail

AUTHENTICATION_IN_METHOD

static final int AUTHENTICATION_IN_METHOD
Authentication is hard-coded in generated code.
See Also:
Constant Field Values

AUTHENTICATION_BY_CALLER

static final int AUTHENTICATION_BY_CALLER
Authentication is passed as parameters in generated code.
See Also:
Constant Field Values

Method Detail

getJavaPackageName

java.lang.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.

getClassName

java.lang.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.

isUseDriverManager

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.

getSQLStatementString

java.lang.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.

getColumnInfo

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:
ISQLFieldInfo

getColMethodsNames

java.lang.String[] getColMethodsNames()
Returns unique names to use as method names to retrieve individual column data. Uses the column alias instead of the column name if one is specified in the SQL statement. Otherwise 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.

getParmInfo

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:
ISQLFieldInfo

getJavaTypeForSql

java.lang.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:
ISQLFieldInfo.getType()

getDriverName

java.lang.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.

getDataSourceName

java.lang.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.

getURL

java.lang.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.

getAuthenticationStyle

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


getUserName

java.lang.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.

getPassword

java.lang.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.