Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Database connectivity with servlet

 
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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("jdbc:odbc:system");

here what should be in place of system?.

please give me proper syntex
 
Paul Clapham
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you sir
i got the solution
problem was at statement

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

 
You got style baby! More than this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic