2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: Eric - netizen1 Access pooled datasource problem 2004-08-15 13:05 I'm using weblogic 8 and its driver to connect to a sql server program. When i use iReport i use JTDS to connect to sql server and all i do is pass an id to generate a report and it works great. I then create a simple app that uses jtds to just to make sure i can generate the pdf file and it does so fine. Now i then created a webapp that generates the pdf but when i do the exact same thing except i pass the weblogic datasouce connection it doesnt pull anything from the database. I retried it with iReport and the simple application using the same Application id and it does. Is there something about a webapp or the driver that is used by WebLogic. I know the pooled connection works in weblogic b/c i query the database to retrieve the application id that i send to the jasper api. Below is the code to generate the pdf so there is nothing special about it. jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath()); conn = connection; System.out.println("Application Id: " + applicationId.toString()); System.out.println("Borrower Type Id: " + borrowerType.toString()); System.out.println("RoadLoans Home: " + reportHome); parameters = new HashMap(); parameters.put("Application_Id", applicationId); parameters.put("RoadLoans_Report_Home", reportHome); parameters.put("Borrower_Type", borrowerType); jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, (java.sql.Connection)conn ); // new JREmptyDataSource()); // (java.sql.Connection)conn ); File pdfOutput = new File(reportDestination); JasperExportManager.exportReportToPdfFile(jasperPrint, pdfOutput.toString()); By: Eric - netizen1 RE: Access pooled datasource problem 2004-08-15 15:23 I take it back i decided to try the jtds driver to create the connection in the webapp (the same code that does it on the simple stand alone app) and i get the same error. Am i doing something wrong here? By: Eric - netizen1 RE: Access pooled datasource problem 2004-08-15 21:38 OK After doing more test i found out that the data i was quering had null data. So i found an app that does have data and see that the jtds does work while the weblogic driver doesnt. The difference between the two is that the weblogic connection is being retrieved from a pool which does work b/c i use it to query data before passing it to the report. Since that didnt work i then got another connection from the pool but with the same result. But when i use jtds and load the driver it was fine. Thanks 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