★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum9/HTML/000010.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  Java Servlets
  running jdbc with servlet

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   running jdbc with servlet
ajay
Junior Member
posted April 14, 2000 07:05 AM     Click Here to See the Profile for ajay   Click Here to Email ajay     Edit/Delete Message Reply w/Quote
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     Click Here to See the Profile for plato     Edit/Delete Message Reply w/Quote
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     Click Here to See the Profile for Amit   Click Here to Email Amit     Edit/Delete Message Reply w/Quote
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     Click Here to See the Profile for Robman   Click Here to Email Robman     Edit/Delete Message Reply w/Quote
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     Click Here to See the Profile for Amit   Click Here to Email Amit     Edit/Delete Message Reply w/Quote
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.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.