Hi
Since I'm using a newer release of JRC a replacement of database connection information do not work any more. I've no idea why. This code worked with a JRC version from last autumn (unfortunately I don't have a release number):
ReportClientDocument doc = new ReportClientDocument();
doc.open("report.rpt");
IDatabase db = null; // get sub report database
// we'll overwrite the database connection information within
// the chosen report.
Map<String, String> bag = new HashMap<String, String>();
bag.put("Connection URL", "jdbc:oracle:thin:@LOCALHOST:1521:DATABASENAME");
bag.put("Server Type", "JDBC (JNDI)");
bag.put("Database DLL", "crdb_jdbc.dll");
bag.put("Database Class Name", "oracle.jdbc.driver.OracleDriver");
for (Object table : db.getTables()) {
updateTable(dhb, dc, (ITable)table, bag);
}
...
private void updateTable(DatabaseController dc, ITable table,
Map<String, String> bag) throws ReportSDKException {
ITable t = (ITable)table.clone(true);
LOGGER.debug(t.getName());
LOGGER.debug("1: " + t.getConnectionInfo().getAttributes());
IConnectionInfo connInfo = t.getConnectionInfo();
connInfo.setUserName("UserX");
connInfo.setPassword("xxxxx");
connInfo.setAttributes(new PropertyBag(bag));
// LOGGER.debug("ConnInfo Kind: " + connInfo.getKind());
t.setConnectionInfo(connInfo);
// t.setName(((ITable)table).getName());
t.setQualifiedName("UserX" + "." + table.getName());
dc.setTableLocation(table, t);
LOGGER.debug("2: " + t.getConnectionInfo().getAttributes());
}
I get this error: 'Fehler bei der Suche nach JNDI-Namen (UserY)'. That means JRC can not find given JNDI name.
Does anyone knows some changes between those JRC releases? And does anyone knows a solution?
Thank you in advance.
Regards
Thomas