giving correct username& password, get ORA-01017: invalid username/password; logon denied
Just solved a problem similar to this. If an 11g database is configured for case sensitive passwords, but you're trying to connect using a 10g client, the 10g client will send the password all in upper case to the database, hence an invalid password when the password you typed in is clearly correct. So you need to upgrade the client to 11g to get it to send the password in the correct case (but for a quick test you can change your password to all upper case and you'll be able to connect).
Bumped into this thread because I was facing the same problem. The username and password were perfect. Was able to login using those credentials in SQLPlus and from other applications. The datasource.url was also perfect.
While analyzing the errors, found that the ojdbc6.jar that I was using was trying to connect to Oracle 11.1.0.7 whereas my Oracle was 11.2.0.4. Downloaded the latest ojdbc6.jar and tried to connect and voila!