• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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?
 
Sheriff
Posts: 28430
103
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
Sheriff
Posts: 28430
103
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");

 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic