priyankdev Posted November 9, 2011 Share Posted November 9, 2011 Hi,I am making a call to jrxml to generate report like this JasperReport jasperReport = JasperCompileManager.compileReport(reportSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, paramSMap, conn); But I have to create the conn object using conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", connectionProps);The thing is at other pages I use the Datasource object which we have specified in our DataSource.groovy , like: javax.sql.DataSource dataSourcedef myappsql = new Sql(dataSource)myappsql.rows(queryString)So I need to reuse the datasource so that I donot need to create the connection object with all the url, userid and pwd values specially in the reportsservice page as we need to remove all hardcoded sql connections from each file Link to comment Share on other sites More sharing options...
satyadoorva Posted November 10, 2011 Share Posted November 10, 2011 Can you try Connection con = ds.getConnection();; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now