Skip to Content
0
Former Member
Nov 27, 2006 at 10:47 PM

DB access in JSP ignored

23 Views

<p>Hi everybody</p><p>I created a report in Eclipse against a local MySQL, embedded it in a JSP and deployed it on a local Tomcat for testing. Evrything went smooth but when I reasign an identical remote DB to the report, copy the Web Archive onto a remote JBoss, the DB connection fails (MySQL 1045). </p><p>I assumed that the DB URL is kept inside the report (.rpt) file and that username and password have to be set in the JSP like so:</p><p> IConnectionInfo connInfo1 = new ConnectionInfo();<br /> connInfo1.setUserName(Utilities.DB_USER);<br /> connInfo1.setPassword(Utilities.DB_PASSOWRD);<br /> connInfos.add(connInfo1);</p><p> [...]<br /> //Create Viewer<br /> CrystalReportViewer viewer = new CrystalReportViewer();<br /> viewer.setReportSource(reportSource);<br /> viewer.setEnableLogonPrompt(false); <br /> viewer.setDatabaseLogonInfos(connInfos);</p><p>If I use the remote DB from the local Tomcat it works too.<br /></p><p>Any help is highly appreciated.</p><p>Thanks in advance and regards from Zurich, Switzerland</p><p>Peter </p>