Java
  Home arrow Java arrow Page 4 - Reading a Properties File for a Java Appli...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Reading a Properties File for a Java Application using NetBeans IDE
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-05-31

    Table of Contents:
  • Reading a Properties File for a Java Application using NetBeans IDE
  • How to get the current working folder (or where the current class file exists) in Java
  • Starting to develop a Java application using NetBeans IDE
  • Adding a properties file
  • Reading the connection string from the properties file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Reading a Properties File for a Java Application using NetBeans IDE - Adding a properties file


    (Page 4 of 5 )

    In this section, I shall add a "properties" file to our application using the NetBeans IDE. Please go through the following steps to achieve the same:

    · Within the "Projects" view, right click on "MyDBPack" and go to New -> File/Folder (Fig03).

    · Within the "new file" dialog window, select "Other" in "Categories" and select "Properties File" as "File type" (Fig04).

    ·  Once you click "Next", you will be presented with "New Properties File" dialog.

    ·  Give the filename as "dbconfig" and make sure that it is correctly placed within the "MyDBPack" folder (Fig05).

    · Once you click on "finish," your "Projects" view should look something like the following (Fig 06):

    ·  Double click on "dbconfig.properties" to open the file within IDE and copy following lines into the same:

    url=jdbc:microsoft:sqlserver://serverjaghome:1433
    driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
    user=sa
    password=

    Please be aware that you need to modify the above with your own server name, port, username and password according to your existing SQL Server configuration.

    More Java Articles
    More By Jagadish Chaterjee


       · Hello guys! You can read properties file in a simpler fashion using Java together...
       · ResourceBundle bundle =...
       · Your method getLocalDirName can be improved in three ways:1) you call...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT