posted 14 years ago
sir how i get datasource object for passing to ireport for calling jrxml report
i use this code
Context ctx = null;
DataSource ds = null;
try {
ctx = new InitialContext();
ds = (DataSource) ctx.lookup("jdbc/as400");
} catch (NamingException ex) {
ex.printStackTrace();
}
Connection conn = ds.getConnection();
ServletOutputStream ouputStream = response.getOutputStream();
JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, conn);
but this line give me error
Context ctx = null;
ctx = new InitialContext();
} catch (NamingException ex) {
ServletOutputStream ouputStream = response.getOutputStream();
JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, conn);
please give me idea how i call ireport
thank's
aamir