Search code examples
javaoracle-databasetomcatjdbctnsnames

How should I configure my JDBC with tnsnames for java web app?


I don't seem to know what I am doing wrong, I have been stuck for such a long time.

I have this web application which runs on tomcat server. What does is it uses a TNSnames and JDBC to reach an oracle database. I am using odjbc6.jar for this.

  1. I have set my odjbc6.jar in the library and buildpath, so that is there.
  2. my tnsname is working as intended, I can test it with another program with exaclty the same configuration.
  3. I have set my global enviroment

What am I missing here?


Solution

  • The problem was that tomcat in eclipse didn't compile everything correctly, but when I exported it to a WAR file and hosted it on a tomcat server then it worked.

    It still does not work correctly when I run tomcat on eclipse, which I find strange