|
> I keep getting the following error when I try to run this JSP ""
> com.sun.jsp.JspException: Compilation failed"" I included the code
> hopefully I am missing something simple. I have changed the
> system name and
> the userid and password fields. I was wondering if there might be an
> authority issue. I am using WebSphere 3.02.2 on an AS/400 V4R5...
> Thanks in advance.
I'm not too familiar with websphere, but do you have your java compile command defined? The weblogic app server (which I am familiar with) requires you to tell it the command line to execute to compile the generated java source into class files.
> <%@ page import="java.sql.*"%>
> <%! Connection con = null;%>
> <%! String system = "AS/400/LIB"; %>
> <%! String userId = "USERID"; %>
> <%! String password = "PASSWORD"; %>
> <%! String url = "jdbc:db2://" + system; %>
>
> <%! public Connection getConnection() {
> if(con != null) (return con;)
> try {
> Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
<snip snip snip>
Can I suggest that you try and separate your logic from your presentation? Create another class that contains all the logic required to retrieve the data & massage it (along with methods to deliver the data to those that might inquire). Then in your JSP, import the necessary hierarchy, and call the appropriate methods to retrieve the data and display it.
david
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.