Results 1 to 2 of 2
  1. #1
    rudrakanth is offline Member
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0

    Default Reading a properties file using resource bundle.

    Hello Friends,

    I have a problem in reading a resource bundle.
    I have a properties file with elements

    driver=oracle.jdbc.driver.OracleDriver.
    url=jdbc:oracle:thin:@csc-3far0699:1521:tibco.
    username=scott.
    password=tiger.


    It is reading fine with resouce bundle. But i retrived the keys using getkeys() into an Enumeration keys. When I looped it with keys.hasNextElement() and in loop Iam printing keys.nextElement()......it is looping infinitly by printing only the key username.


    for(Enumeration keys=bundle.getKeys();keys.hasMoreElements();)
    {
    System.out.println(keys.nextElement());

    }

  2. #2
    sunsavesu is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Default

    I hope this code could help U .................. ;)

    Enumeration keys = bundle.getKeys();

    while(keys.hasMoreElements()){
    System.out.println(keys.nextElement());
    }

Similar Threads

  1. Reading a properties file
    By peiceonly in forum New To Java
    Replies: 7
    Last Post: 05-06-2010, 06:17 PM
  2. How to getvalue from properties file into JSP
    By jaga in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-04-2008, 09:00 AM
  3. Replies: 0
    Last Post: 01-30-2008, 10:56 AM
  4. Setting the label of radio buttons from Resource bundle
    By rajeeshankar in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 12-17-2007, 10:23 AM
  5. doubt about language .properties file
    By tommy in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 03:38 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
  •