From: winston ralph (winston.ralph at domain alphyra.ie)
Date: Tue 09 Oct 2001 - 15:19:42 IST
Hi,
Everything is set up and running on Redhat7.1. Version 1.3.1 of jdk is
installed and tomcat version 3.2.1.
I also installed the mod_jserv module and started serving jsp pages
which worked perfectly.
I then downloaded the mysql jdbc drivers from the mysql site and
installed them and set the classpath to
correct path in /etc/profile. I get the following error when connecting
to the mysql database:
Root cause:
java.sql.SQLException: Server configuration denies access to data source
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:144)
at org.gjt.mm.mysql.Connection.(Connection.java:230)
at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at
jsp.num._0002fjsp_0002fnum_0002fnumguess_0002ejspnumguess_jsp_59._jspService(_0002fjsp_0002fnum_0002fnumguess_0002ejspnumguess_jsp_59.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java)
at org.apache.tomcat.core.Handler.service(Handler.java)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java)
at java.lang.Thread.run(Thread.java:484)
***********************************************************************************
Heres the code that i used.
<html><body>
<% at domain page import="java.io.*"%>
<% at domain page import="java.util.*"%>
<% at domain page import="java.sql.*"%>
<% at domain page import="javax.servlet.*"%>
<% at domain page import="javax.servlet.http.*"%>
<%
//try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection Conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql?user=root&password=");
Statement Stmt = Conn.createStatement();
String SQL="SELECT * from user";
ResultSet RS = Stmt.executeQuery(SQL);
while (RS.next()) {
System.out.println(RS.getString(1));
}
// Clean up after ourselves
RS.close();
Stmt.close();
Conn.close();
//}
//catch (SQLException E) {
// System.out.println("SQLException: " + E.getMessage());
// System.out.println("SQLState: " + E.getSQLState());
// System.out.println("VendorError: " + E.getErrorCode());
//}
%></body></html>
*******************************************************************************
Now if I uncomment the commented code I get no error but I also get no
results which is wrong.
I'm thinking there is a priviledge problem. The mysql database is set up
to alloow any user to connect.
Any help would be greatly appreciated.
Winston
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:12:38 GMT