Oracle JDBC : invalid username/password (ora-01017)

后端 未结 3 861
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 02:27

I have a strange problem with jdbc connection to an oracle database server.

We\'ve applications on a tomcat server running. These application use an oracle database.

相关标签:
3条回答
  • 2020-12-02 02:35

    I'd check Oracle listener and trace logs. As Aaron Digulla said, it does sound like some resource exhaustion.

    0 讨论(0)
  • 2020-12-02 02:50

    Odd. Some ideas:

    1. Log the user name and password for a few days just to make sure they are correct. Some bug in the code might overwrite a value that you don't expect.

    2. Consider to use JNDI with a connection pool provided by Tomcat. DBCP has some really advanced options to check whether a connection is still alive and how to reconnect it. After that, you shouldn't see any connection related issues in your logs anymore. This would also improve security because none of the apps need to know the DB password anymore.

    3. It might be a problem with resource leaks (happens if an app never returns the connection) but I'd expect a different error message, then.

    4. Some databases (DB2, H2) allow to create views that make remote tables from other databases visible like local tables. Not sure whether Oracle supports this but if it does, then maybe the user name/password for this remote table is wrong.

    Also consider the points in this blog post: Oracle ORA-01017 tips

    At first glance, nothing in the post could cause your problems but maybe some script is manipulating the tnsnames.ora (for example distributing a new copy).

    Or the DBA disabled all users for the time of the daily backup.

    0 讨论(0)
  • 2020-12-02 03:02

    For me incompatible version of OracleDriver was causing this issue Your application should either register oracle driver manually (which jar that I needed to work with was doing) or agter java 6 ojdbc.jar should be in the classpath for your application. So google compatible driver version for your oracle installation and either declare it in your pom file (with needed plugin to put it in the resulting jar) and reference it manually from code or put the ojdbc.jar somewhere your jar can see it Usefull links:

    About connecting to oracle db: https://www.codejava.net/java-se/jdbc/connect-to-oracle-database-via-jdbc

    About java classpath: https://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html

    0 讨论(0)
提交回复
热议问题