XML config with Java application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML config with Java application

  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Question XML config with Java application



    hi all,

    First of all, I would like to say hello to all...
    This is my first post to the forum.

    Through this post, I would like to ask for some guide to the problem that i am facing.

    Recently, I was writing a JAVA application that can delete files after a certain time in computer.

    Now, I am planning to storing the java application settings in XML .config file so that it can update certain application attributes without having to recompile the application.
    For example, suppose you’ve developed an application to access a database on a SQL Server and you chose to hard-code the connection information in the application.

    Now you want to move the database to a different server. Because the connection information is hard-coded in the application, you’ll have to modify, recompile, and redeploy the application to make this change.

    But if you’re using a .config file, the change is as easy as modifying the ConnectionString key in the .config file.

    Lastly, I hope someone who knows about this may kindly reply to this post.

    many thanks in advance.

    regards,
    javaenthusiast

  2. #2
    Join Date
    Mar 2004
    Posts
    78
    see the java.util.Properties class that is part of Java5. It supports XML files and you can use it to store your config data.

    If it does not suit you - write your own XML file and parse it manually by using DOM or SAX - both available in JavaSE.

Similar Threads

  1. Parsing XML in Java
    By (MC3)RaVeN in forum Java
    Replies: 3
    Last Post: 04-03-2008, 04:17 AM
  2. .NET vs. Enterprise Java: Who's Got Better Security?
    By Glen Kunene in forum Talk to the Editors
    Replies: 17
    Last Post: 03-23-2002, 12:43 AM
  3. Replies: 1
    Last Post: 01-26-2001, 04:17 AM
  4. Java Web Application Developer at Montclare Technologies
    By Montclare Technologies in forum Java
    Replies: 0
    Last Post: 09-20-2000, 02:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center