A friendly DB admin came to the rescue, and found that this is actually an Oracle bug:
Problem Description:
--------------------
When trying to connect by using the JDBC THIN 11g driver to a database 11g
using Enterprise User Security (EUS) connections throw invalid username/
When usign the JDBC OCI driver the connection can be made.
And now - hold on to your hats:
Available Workarounds:
----------------------
Use OCI.
Note that I used 11.2.0.4, while the bug says
Tested Versions:
----------------
JDBC THIN Driver 11.1.0.6.0 and 11.1.0.7.0
So apparently it's been around for a while. I'm not sure I get this - why are they bringing out new versions of this driver if it fails on connecting you to the database properly? Seems this would be the first issue everybody runs into when using the thin driver?
But then, our local DB admin hero dug this up:
Set the property oracle.jdbc.thinLogonCapability=o3 for the JDBC connection by passing the option oracle.jdbc.thinLogonCapability=o3 on the command line.
For example:
java -Doracle.jdbc.thinLogonCapability=o3 <Java Class>
There is no loss of security when following this workaround.
In Eclipse, I've added this line to the VM arguments (Run -> Run Configurations -> Arguments -> VM arguments -> add -Doracle.jdbc.thinLogonCapability=o3) and, lo and behold, I can finally get into the database.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…