|
I used the below source in my program with java 1.4 and it's compiled successfully,
source:
-------------------------------------------------
//Obtain collection of tables from this database controller.
Tables tables = databaseController.getDatabase().getTables();
//Set the datasource for all main report tables.
for (int i = 0; i < tables.size(); i++)
{
ITable table = tables.getTable(i);
//Keep existing name and alias.
table.setName(table.getName());
table.setAlias(table.getAlias());
table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
//Change connection information properties.
IConnectionInfo connectionInfo = table.getConnectionInfo();
//Set new table connection property attributes.
PropertyBag propertyBag = new PropertyBag();
//Overwrite any existing properties with updated values.
propertyBag.put("Trusted_Connection", "false");
propertyBag.put("Server Name", SERVERNAME); //Optional property.
propertyBag.put("Connection String", CONNECTION_STRING);
propertyBag.put("Database Name", DATABASE_NAME);
propertyBag.put("Server Type", "JDBC (JNDI)");
propertyBag.put("URI", URI);
propertyBag.put("Use JDBC", "true");
propertyBag.put("Database DLL", DATABASE_DLL);
connectionInfo.setAttributes(propertyBag);
//Set database username and password.
//NOTE: Even if these the username and password properties don't change when switching databases, the
//database password is *not* saved in the report and must be set at runtime if the database is secured.
connectionInfo.setUserName(DBUSERNAME);
connectionInfo.setPassword(DBPASSWORD);
connectionInfo.setKind(ConnectionInfoKind.SQL);
table.setConnectionInfo(connectionInfo);
//Update old table in the report with the new table.
databaseController.setTableLocation(table, tables.getTable(i));
}
--------------------------------------------------
But if i compiled it in java 1.6 then the following error occurs :
D:\IntegTest Version 1.6\Classes>javac ExecReport.java
ExecReport.java:219: incompatible types
found : com.crystaldecisions.sdk.occa.report.data.ITable
required: general.ITable
ITable table = tables.getTable(i);
^
ExecReport.java:222: cannot find symbol
symbol : method getAlias()
location: class general.ITable
table.setAlias(table.getAlias());
^
ExecReport.java:223: cannot find symbol
symbol : method setQualifiedName(java.lang.String)
location: class general.ITable
table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
^
ExecReport.java:226: cannot find symbol
symbol : method getConnectionInfo()
location: class general.ITable
IConnectionInfo connectionInfo = table.getConnectionInfo();
^
ExecReport.java:248: cannot find symbol
symbol : method setConnectionInfo(com.crystaldecisions.sdk.occa.report.data.ICo
nnectionInfo)
location: class general.ITable
table.setConnectionInfo(connectionInfo);
^
ExecReport.java:251: setTableLocation(com.crystaldecisions.sdk.occa.report.data.
ITable,com.crystaldecisions.sdk.occa.report.data.ITable) in com.crystaldecisions
.reports.sdk.DatabaseController cannot be applied to (general.ITable,com.crystal
decisions.sdk.occa.report.data.ITable)
databaseController.setTableLocation(table, tables.getTable(i));
^
Note: ExecReport.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors
Please provide me the solution for the above error.
|