Jump to content
JasperReports Library 7.0 is now available ×

Datasource/ResultSet Errors in JSP


Recommended Posts

By: Ryan - louier79

Datasource/ResultSet Errors in JSP

2003-08-12 11:34

Hello,

 

I am getting these errors:

JasperReports encountered this error :

com.caucho.java.JavaCompileException: /~lewis/crash/jsp/webbills/jsp/pdf.jsp:12: Class _jsp._webbills._jsp.ResultSet not found.

ResultSet rs = DatabaseUtils.executeSelect( jasperReport.getQuery().getText() );

^

/~lewis/crash/jsp/webbills/jsp/pdf.jsp:12: Undefined variable or class name: DatabaseUtils

ResultSet rs = DatabaseUtils.executeSelect( jasperReport.getQuery().getText() );

^

/~lewis/crash/jsp/webbills/jsp/pdf.jsp:13: Class _jsp._webbills._jsp.ReportDatasource not found.

ReportDatasource datasource = new ReportDatasource( rs );

^

/~lewis/crash/jsp/webbills/jsp/pdf.jsp:13: Class _jsp._webbills._jsp.ReportDatasource not found.

ReportDatasource datasource = new ReportDatasource( rs );

^

4 errors

 

Here is the jsp:

<%@ page errorPage="error.jsp" %>

<%@ page import="dori.jasper.engine.*" %>

<%@ page import="java.util.*" %>

<%@ page import="java.io.*" %>

 

<%

File reportFile = new File(application.getRealPath("/reports/StudentBills.jasper"));

 

Map parameters = new HashMap();

parameters.put("BaseDir", reportFile.getParentFile());

 

ResultSet rs = DatabaseUtils.executeSelect( jasperReport.getQuery().getText() );

ReportDatasource datasource = new ReportDatasource( rs );

 

byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, datasource);

 

response.setContentType("application/pdf");

response.setContentLength(bytes.length);

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(bytes, 0, bytes.length);

ouputStream.flush();

ouputStream.close();

%>

 

Please advise and thank you for your assistance!

 

 

 

 

By: Gregory A. Swarthout - gswarthout

RE: Datasource/ResultSet Errors in JSP

2003-08-12 11:39

Where are you importing:

 

_jsp._webbills._jsp.ResultSet

DatabaseUtils

ReportDatasource

 

?

 

 

 

 

By: Ryan - louier79

RE: Datasource/ResultSet Errors in JSP

2003-08-12 16:34

<p>Sorry, I copied from an incorrect forum message: <a href="http://sourceforge.net/forum/message.php?msg_id=1762162">http://sourceforge.net/forum/message.php?msg_id=1762162</a></p>

<p>Should have copied from: <a href="http://sourceforge.net/forum/message.php?msg_id=1763651">http://sourceforge.net/forum/message.php?msg_id=1763651</a></p>

 

Do you know of any good examples of the jsp using jdbc?

 

Thank you!

 

 

 

 

 

 

By: Ryan - louier79

RE: Datasource/ResultSet Errors in JSP

2003-08-12 16:35

Sorry, I copied from an incorrect forum message: http://sourceforge.net/forum/message.php?msg_id=1762162

 

Should have copied from: http://sourceforge.net/forum/message.php?msg_id=1763651

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...