|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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 ------------------------------------------ |
|
#2
|
|||
|
|||
|
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 <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>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[/quote] |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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.
|
|
#6
|
|||
|
|||
|
I've got the same problem. I've installed JServ, JDBC v 1.2b, and MySQL 3.22.32 running on Linux. When I try to connect do my DataBase i get following exception:
Server configuration denies access to data source When I try to connect to the same DB (same tables) but running on NT it works fine. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > running jdbc with servlet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|