Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Paramaters to update properties file

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Paramaters to update properties file

    Hi,

    I have an application which reads from a properties file.

    Properties file contains:

    server=a.b.c.net/silverlight/etc
    user_id=d0nal
    report=rund0nalreport
    param1=a
    param2=b
    and so on for as many parameters as necessary

    This works fine and I am able to call the properties file and use them in my public class. However I want to be able to pass some of these parameters from the command line so:

    java -jar client.jar user_id report param1 param2

    I then want to update the properties file with these values before calling them in my main application, and going off to query the server.

    Can someone tell me if this is doable, and if so how?


  2. #2
    Member
    Join Date
    Sep 2011
    Posts
    32
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Paramaters to update properties file

    Hello,

    Why don't update the properties file at the beginning of your main() method if the parameters exist?

    java memory
    Last edited by namhm; December 4th, 2011 at 06:48 PM.

Similar Threads

  1. Want to Update Class File content
    By AlokPatil in forum Member Introductions
    Replies: 1
    Last Post: August 26th, 2011, 11:45 PM
  2. Store HexDecimal Color Code in .properties file?
    By techwiz24 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 27th, 2011, 08:45 PM
  3. Structured Properties File?
    By moka in forum Java Theory & Questions
    Replies: 7
    Last Post: October 19th, 2010, 11:14 AM
  4. Cannot update data in .txt/.csv file
    By Azriq007 in forum JDBC & Databases
    Replies: 2
    Last Post: October 16th, 2010, 09:16 PM
  5. Accessing Properties File
    By java_mein in forum Java Servlet
    Replies: 5
    Last Post: May 14th, 2010, 02:44 AM