This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

War file deployment + configuration

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have done a simple web application, that uses a database connection and I need to make a war file and a deployment script for that app using ant.

So far I have done a simple build.xml so, that it compiles my project, creates a war file and copys it to the server and it works fine. The problem is, that in this build.xml, I don't have to edit the database connection parameters, but when I give that to the client, he needs to.

The database information is stored in META-INF/context.xml file, that must be edited.

The installations should involve steps like:
1. Specify the server deployment paht in build.xml
2. Specify the database connection parameters in build.xml (or in other file).
3. run "ant"

NOTE: The .war file must allready be in present. This ant script only installs the .war file. It does not build it.


So what are my options? I am really new to ant. Help is very welcome.
 
Saloon Keeper
Posts: 21126
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you're configuring your database the hard way. The preferred method is to use a database connection pool, which your app locates via JNDI. The database connection pool is defined to your appserver. A pool is generally preferred to getting connections individually, since it usually costs a lot of resources to make a connection, but relatively little to check it in and out of a pool.

Since the database pool is defined to the appserver, you don't have to place any datase driver info or URLs in the application deployment unit (WAR).
[ June 19, 2006: Message edited by: Tim Holloway ]
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!