|
Author
|
Topic: running jdbc with servlet
|
ajay Junior Member
|
posted April 14, 2000 07:05 AM
i have installed jserv module on my unix server with virtual BSD flavour.the servlets are running fine there. now i want to connect mysql database to the servlets.i have installed the mm mysql driver at /usr/local/jdk1.1.8 and set the classpath. But it was not working the ..mm.mysql.Driver class was not found. then i put all the org.gjt... class package to the /sr/etc/httpd/servlets directory , now my servlet could find the mm.mysql.Driver class but the connection is not made with the server. the connection string i have passed is "jdbc:mysql://myhost(localhost):3306/databasename?user=username&password=pass"; i have created a seperate user and permitted all the access to him in the mysql user database.i have tried all the option in the connection string but i am still getting the error message ------------------------------------- java.sql.SQLException: Server configuration denies access to data source Connection null Exception is here java.lang.NullPointerException ------------------------------------------ |
plato Junior Member
|
posted April 18, 2000 06:14 AM
Hi,Firstly make sure you have added the mysql driver to your classpath, and then make sure you have given the mysql user you created access from localhost. If you have done these then ignore this  plato quote: Originally posted by ajay: i have installed jserv module on my unix server with virtual BSD flavour.the servlets are running fine there. now i want to connect mysql database to the servlets.i have installed the mm mysql driver at /usr/local/jdk1.1.8 and set the classpath. But it was not working the ..mm.mysql.Driver class was not found. then i put all the org.gjt... class package to the /sr/etc/httpd/servlets directory , now my servlet could find the mm.mysql.Driver class but the connection is not made with the server. the connection string i have passed is "jdbc:mysql://myhost(localhost):3306/databasename?user=username&password=pass"; i have created a seperate user and permitted all the access to him in the mysql user database.i have tried all the option in the connection string but i am still getting the error message
|
Amit Junior Member
|
posted April 21, 2000 05:58 AM
i am also facing the same problem and the error i am getting is unauthorised access to user@localhost. Now i'll try to run it on remote server and then will see whether it works or not. |
Robman Member
|
posted April 21, 2000 01:32 PM
Try taking the "username=" and "password=" out of the string and just use the actual users name (and password if necessary). I had done the same thing and this fixed it for me. |
Amit Junior Member
|
posted April 22, 2000 02:41 AM
Finally my problem is fixed. I made a newuser in MySQL and granted him all the priviliges. But there is one thing, the password must be of eight characters else java program is giving unauthorized access exception. |