Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Prof. JSP Second Edition -Chap 3 problems


Message #1 by "John" <chichi_1012@y...> on Tue, 9 Oct 2001 05:31:21
Here is a  page dump of my problem and the code that generates it.
My server is Mac OS 10.1 and running the mm.mysql-2.0.4-bin.jar file.
These problems started when the server was upgraded to 10.1 it worked before
on OS 10 and continues to work on my win32 development machine.
The code works fine when I write it in PHP though so it must be my JSP or
tomcat.... any suggestions

Thanks
James McIntosh
james@m...

Root cause:
java.sql.SQLException: Server configuration denies access to data source

you can view the full error at www.mcintosharcing.com/catalogue.jsp

here is the code
<%
      Class.forName("org.gjt.mm.mysql.Driver");
       Connection myConn 
DriverManager.getConnection("jdbc:mysql:///norton?user=theDatabase&password
thePassword");
        java.sql.Statement stmt = myConn.createStatement();
        ResultSet myResultSet = stmt.executeQuery("select CATEGORY from
category ORDER BY ID");
      if (myResultSet != null) {
       while (myResultSet.next()) {
       String category = myResultSet.getString("CATEGORY");
     out.println("<option value='" + response.encodeURL(category) + "'>" +
category + "</option>");
             } /* of while */
         }  /* of if */
     %>





  Return to Index