• Post Reply Bookmark Topic Watch Topic
  • New Topic

Database connectivity with servlet  RSS feed

 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone
i am using Net Beans for servlet programming.And i am using Oracle for database connectivity.
connection is successful but when i run the code,it show a error as blow:

java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01017: invalid username/password; log on denied

according to me my user name and password are correct,so please give your suggestion


 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gursewak Singh wrote:according to me my user name and password are correct

Well, the database disagrees with you...

Are you sure they are correct? Can you connect with the same username and password using the database administration tools that you got with your database? Are you sure you are connecting to the right server, and not some other server?
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The database driver says your user ID and password are wrong. You say they are right. So in this case you are wrong.

Of course you might be wrong because you're not connecting to the database you meant to connect to, or for other reasons. But just saying "I'm right" isn't a productive approach to getting your code working.
 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir i can log in using my user name and password when i start working with it.
but during connectivity it cause problem.
i am agree with you that i can wrong. but where???
that is the question.
Now
please tell me if your connection is successful then how to work with it

Connection con = DriverManager.getConnection("jdbcdbc:system");

here what should be in place of system?.

please give me proper syntex
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ODBC? In a servlet? When you're connecting to an Oracle database? Yuck. Forget about that and use the Oracle JDBC driver which matches your database.
 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir
i got the solution
problem was at statement

Connection con = DriverManager.getConnection("jdbcdbc:system");

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!