You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Draucker <ri...@draucker.com> on 2001/08/15 17:04:23 UTC
db connection denied access
This is odd and I'm stumped. I have a simple db connection class in a jar
under ~app/WEB-INF/lib. I have a servlet under ~app/WEB-INF/classes that
imports this connection class. The mm.mysql driver jar also resides in this
WEB-INF/lib.
The servlet accesses the connection class just fine. But, when the
connection class attempts a connection to the database I get the error:
java.sql.SQLException: Server configuration denies access to data source
However, if I cut 'n paste the code from the connection class into the
servlet I have no problem with the connection or data retrieval.
FYI:
RH7.1 new installation
jdk 1.3.1
Tomcat 3.2.1
MySQL 3.2.2
--
Richard Draucker richard@protected-data.com
Protected-Data.Com www.protected-data.com
Remote Data Support For Web Developers
Re: db connection denied access
Posted by Richard Draucker <ri...@draucker.com>.
Thanks, I found the problem. Probably shoulda posted this on the MySQL
group, sorry. Using the host ip in the connection url for the db generates
the error. Using 'localhost' or any host name that the database considers
valid works just fine.
- Richard
On Wednesday 15 August 2001 11:04 am, you wrote:
> This is odd and I'm stumped. I have a simple db connection class in a jar
> under ~app/WEB-INF/lib. I have a servlet under ~app/WEB-INF/classes that
> imports this connection class. The mm.mysql driver jar also resides in
> this WEB-INF/lib.
> The servlet accesses the connection class just fine. But, when the
> connection class attempts a connection to the database I get the error:
>
> java.sql.SQLException: Server configuration denies access to data source
>
> However, if I cut 'n paste the code from the connection class into the
> servlet I have no problem with the connection or data retrieval.
>
> FYI:
> RH7.1 new installation
> jdk 1.3.1
> Tomcat 3.2.1
> MySQL 3.2.2
--
Richard Draucker richard@protected-data.com
Protected-Data.Com www.protected-data.com
Remote Data Support For Web Developers
Re: db connection denied access
Posted by Tim O'Neil <ti...@xythos.com>.
At 11:49 AM 8/15/2001, you wrote:
>If you're going to be using MySQL, do yourself a favor and buy this book:
>
>http://www.amazon.com/exec/obidos/ASIN/0735709211/qid=997901246/sr=2-2/107-4
>535935-5049369
Or, do yourself a bigger favor and use Postgres.
Re: db connection denied access
Posted by Jeff Kilbride <je...@kilbride.com>.
You need to read chapters 4.2 and 4.3 of the MySQL manual:
http://www.mysql.com/doc/P/r/Privilege_system.html
http://www.mysql.com/doc/U/s/User_Account_Management.html
MySQL has a somewhat strange privilege system for granting access to the
database. But it's very flexible, once you learn it.
If you're going to be using MySQL, do yourself a favor and buy this book:
http://www.amazon.com/exec/obidos/ASIN/0735709211/qid=997901246/sr=2-2/107-4
535935-5049369
It's invaluable.
--jeff
----- Original Message -----
From: "Richard Draucker" <ri...@draucker.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, August 15, 2001 8:04 AM
Subject: db connection denied access
> This is odd and I'm stumped. I have a simple db connection class in a jar
> under ~app/WEB-INF/lib. I have a servlet under ~app/WEB-INF/classes that
> imports this connection class. The mm.mysql driver jar also resides in
this
> WEB-INF/lib.
> The servlet accesses the connection class just fine. But, when the
> connection class attempts a connection to the database I get the error:
>
> java.sql.SQLException: Server configuration denies access to data source
>
> However, if I cut 'n paste the code from the connection class into the
> servlet I have no problem with the connection or data retrieval.
>
> FYI:
> RH7.1 new installation
> jdk 1.3.1
> Tomcat 3.2.1
> MySQL 3.2.2
>
>
> --
> Richard Draucker richard@protected-data.com
> Protected-Data.Com www.protected-data.com
> Remote Data Support For Web Developers
>