try
{
// create catalog bean
JRCatalog jrCatalog = new JRCatalog();
// set report home
jrCatalog.setReportHome( "c:\\jrcbean");
// load catalog
jrCatalog.setCatName("c:\\a.cat">);
loadCatalog();
// modify connection
ConnectionDesc conDesc = new ConnectionDesc();
conDesc.strName = "Demo";
conDesc.strURL = "jdbc:oracle:thin:@myhost:1521:orcl";
conDesc.strUser = "System";
conDesc.strPassword = "Manager";
conDesc.strDriver = "oracle.jdbc.driver.OracleDriver";
jrCatalog.modifyConnection(conDesc);
// save catalog
jrCatalog.saveCatalog();
// close catalog
jrCatalog.closeCatalog();
}
catch(JRCatalogException e)
{
System.out.println(e);
}
|