2

I've an application running on a dev server and connecting to a dev-db hosting an oracle instance.

Now i'm deploying the on a prod/prod-db machine

Since the dev-db url is hardcoded inside the java code, the just-copied binaries still points to dev-db. As a quick warkaround i added a line in Windows Host file on prod so that dev-db now points to prod-db IP address. It's work, but i'm not very satisfied of this global-scope solution.

I was wondering if exits a way to make a hosts file "private" for a certain environments ie. only valid in the scope of my running application

Gabriele B
  • 2,665
  • 1
  • 25
  • 40

1 Answers1

1

No, there's no way to do this, and it's a bad approach anyway.

You should instead fix the real problem, which is the hard-coding of the address inside your java code. Put such things in a properties file, and use a different properties file for production.

Don Roby
  • 40,677
  • 6
  • 91
  • 113
  • I will, but i need a temp workaround anyway: the application is a cluster on hundreds of indipendent jobs, i need time to fix-compile-deploy anyone of them :) tnx for the answer! – Gabriele B Sep 06 '11 at 12:21