How to read and update the value of property file

Hi,
I am not able read the values from property file.
Please tell me how to read and update the values from property file using Properties class
This is my property file : - Config.properties its located in D:\newfolder
Values
SMTP = localhost
Now i need to change the value of the SMTP
New value :
SMTP =10.60.1.9
Pls Help me
Thanks
Merlin Rosina,

Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

Similar Messages

  • How to update the value in xml file using transformer after setNodeValue

    Hi,
    This is my code
    I want to set update the values in xml file using transformer..
    Any one can help me
    This is my Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    Jsp Page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <% String str="";
    String str1="";
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    out.println("Before change");
    NodeList n11 = doc.getElementsByTagName("name");
    Node n22= n11.item(0).getFirstChild();
    str1 = n22.getNodeValue();
    out.println(str1);
    out.println("After change");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    node.setNodeValue(name);
    NodeList n1 = doc.getElementsByTagName("name");
    Node n2= n1.item(0).getFirstChild();
    str = n2.getNodeValue();
    out.println(str);
    catch(Exception e)
    out.println(e) ;
    %>
    <h1><%=str%></h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>

    hi check this exit...
    IWO10012

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • Loop through xml and update the value

    I have the following xml table. I need to update the Field which name="data"
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Root name="xyz">
    <Row id="1">
    <Field name="data">456</Field>
    <Field name="time">2005-02-08 10:43:51</Field>
    </Row>
    <Row id="2">
    <Field name="data">123</Field>
    <Field name="time">2005-02-08 10:43:16</Field>
    </Row>
    </Root>
    After update, the table should look like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Root name="xyz">
    <Row id="1">
    <Field name="data">abc</Field>
    <Field name="time">2005-02-08 10:43:51</Field>
    </Row>
    <Row id="2">
    <Field name="data">edf</Field>
    <Field name="time">2005-02-08 10:43:16</Field>
    </Row>
    </Root>
    How do I update the value through java program? I do not want to load the data to database to update the value. The constrain is that i must have the value updated in java application before I loaded it to the database.
    Please any advise?
    Thank you!

    Use a DOM parser to parse the xml document...you will get a Document object, which you can use XPath or traverse the DOM tree and perform the updating.

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to identify and update the DB parameters (no SYS access)

    Hi experts,
    I have to check some parameter values for an OID tuning
    I do not have sys access, I have only schema user access
    Now how do I see the values of SGA_TARGET, db_cache_size etc parameter
    I manage to see these var in init.ora file under /dbs folder but there are 2-3 spfile also having containing these attributes, not sure which reflect the actual.
    Also can I alter also these value via schema user or do I need SYS access?
    Would appreciate if i can get help in this
    Thank you

    DK2010 wrote:
    Hi,
    Welcome to the forum,
    You need DBA access to see the value and sysdba access to alter the value.
    if you are able to check the file under the /dbs then you can identify the spfile naming with your database name
    generally it look like
    spfile<sid>.ora of init<sid>.ora
    you can use the cat command to see the value like
    cat init<sid>.ora|grep -i sga
    HTH'cat' will work, but since the spfile is a binary file, the 'strings' command would be the better choice:
    oracle:hr91dvvb$ ls -l spfile*
    -rw-r----- 1 oracle dba 2560 Apr 22 15:53 spfilehr91dvvb.ora
    oracle:hr91dvvb$ cat spfilehr91dvvb.ora
    C"ݾoè{0CC"!r91dvvb.__db_cache_size=339738624
    hr91dvvb.__java_pool_size=4194304
    hr91dvvb.__large_pool_size=4194304
    hr91dvvb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    hr91dvvb.__pga_aggregate_target=339738624
    hr91dvvb.__sga_target=503316480
    hr91dvvb.__shared_io_pool_size=0
    hr91dvvb.__shared_pool_size=146800640
    hr91dvvb.__streams_pool_size=0
    *.audit_file_dest='/u01/app/oracle/admin/hr91dvvb/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.0.0'
    *.control_files='/oradata/hr91dvCC",2vb/control01.ctl','/oradata/hr91dvvb/control02.ctl','/oradata/hr91dvvb/control03.ctl'
    *.db_block_size=8192
    *.db_domain=''
    *.db_name='hr91dvvb'
    *.db_unique_name='hr91dvvb'
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=hr91dvvbXDB)'
    *.memory_target=842006528
    *.open_cursors=300
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.undo_tablespace='UNDOTBS1'
    CC"GeCC"FeCPuTTYPuTTY
    oracle:hr91dvvb$ PuTTYPuTTY
    oracle:hr91dvvb$ strings spfilehr91dvvb.ora
    hr91dvvb.__db_cache_size=339738624
    hr91dvvb.__java_pool_size=4194304
    hr91dvvb.__large_pool_size=4194304
    hr91dvvb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    hr91dvvb.__pga_aggregate_target=339738624
    hr91dvvb.__sga_target=503316480
    hr91dvvb.__shared_io_pool_size=0
    hr91dvvb.__shared_pool_size=146800640
    hr91dvvb.__streams_pool_size=0
    *.audit_file_dest='/u01/app/oracle/admin/hr91dvvb/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.0.0'
    *.control_files='/oradata/hr91dv
    vb/control01.ctl','/oradata/hr91dvvb/control02.ctl','/oradata/hr91dvvb/control03.ctl'
    *.db_block_size=8192
    *.db_domain=''
    *.db_name='hr91dvvb'
    *.db_unique_name='hr91dvvb'
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=hr91dvvbXDB)'
    *.memory_target=842006528
    *.open_cursors=300
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.undo_tablespace='UNDOTBS1'
    oracle:hr91dvvb$
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to Get and Update properties values from XML tag Using Xquery or PL Sql

    Hi
    I have this tag
    <Solicitud Pais = "1">
    How i can get Pais value?
    How i can update Pais Value?
    Y can use Xquery funtions or PL SQL for this?
    Thak's
    Angel

    How i can get Pais value? ExtractValue
    How i can update Pais Value?UpdateXML
    Y can use Xquery funtions or PL SQL for this?Yes
    Without knowing more about your requirements, where information resides, or even a version of Oracle, that is the best I'll do.

  • How to read and set Pane value for new adding folder

    Hi Experts,
    I tried to add a new folder in to a system form as below
    Itm = form.Items.Add("UserFolder"), SAPbouiCOM.BoFormItemTypes.it_FOLDER)
    form.DataSources.UserDataSources.Add("F_new", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
    Dim oFolder As SAPbouiCOM.Folder
    oFolder.DataBind.SetBound(True, "", "F_new")
    oFolder.GroupWith("138")
    My quester is what is the panelevel for this new folder? And how to set value to panelevel for this folder.
    If we design a folder from Screen Painter, we can set the pane value manually, can we do this from code?
    Thanks a lot
    Tim

    Hello,
    You do not have to set any panelevel for your folder, if you would like to display it all the panelevels. (Let's see an example on Item Master data form).
    Sales, Purchase, Inventory etc tabs (folders) are always visible, there is no panelevel set for them.
    To change between panelevels, you can trigger et item pressed event, and  before_action = false, then you may change the panelevel of the form poperly.
    For initially you may use the Folder.Select() command to show the default panelevel
    >The problem is here, it looks like oFrom.Panelevel property can only accept integer value, so how can I know what's the pane level number for my folder?
    Do not set panelevel for your folders, you should drive your form's panelevel based on a selection tree:
    To see clear, please check the following code in the help sample: CompexForm
    C:Program FilesSAPMásolat - SAP Business One SDKSamplesCOM UIVB.NET07.ComplexForm2003
    to make it clear:
            '// Adding Folder items
            For i = 1 To 2
                oItem = oForm.Items.Add("Folder" & i, SAPbouiCOM.BoFormItemTypes.it_FOLDER)
                oItem.Left = (i - 1) * 100
                oItem.Width = 100
                oItem.Top = 6
                oItem.Height = 19
                oFolder = oItem.Specific
                '// set the caption
                oFolder.Caption = "Folder" & i
                oFolder.DataBind.SetBound(True, "", "FolderDS")
                If i = 1 Then
                    oFolder.Select()
                Else
                    oFolder.GroupWith(("Folder" & i - 1))
                End If
            Next i
    This code add 2 folders to the form: and the first (i = 1) is selected.
    IN itemevent, the panelevel property of the form is depending from the item you have clicked:
    Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                        '// Check if the event was raised by one of the Folder items
                        '// and change the form's pane level
                        If pVal.ItemUID = "Folder1" Then
                            oForm.PaneLevel = 1
                        End If
                        If pVal.ItemUID = "Folder2" Then
                            oForm.PaneLevel = 2
                        End If
    Regards
    János

  • Reading and Updating the table at the same time

    Hi all
    I need to read from a table to check whether a record exist in there or not, then  if not add the record to the table (in the same dataflow). Is there any way to use a table as a source and as a target at the same time?
    While I'm doing this procedure, I don't want to add a record that I had inserted before twice  (I need to get the latest veriosn of the table when I'm working with that). For example, in the same process, when I check the table and the record was not there, I insert the record, I read the table again , if this time again I want to read the same record that I had inserted just before, does DS distingish that, or all records will be comitted based on the commit size which is by default 1000?
    I can not change the commit size to 1 to tell DS to commit record by record, as I have turned on the transactional load and the commit size is disabled for me.
    Do you have any experience about my problem?
    Any help is greatly appreciated.

    You need two dataflows. A first that reads your source and inserts/updates the lookup table. And then you read your source again and use the now current lookup table.
    Even if you would set the commit rate to 1 it would not help as there are so many buffers between the transforms. What you would require is that only one row is in the dataflow at any given time - and that would take ages.

  • How to read and write the data like this(is JSON?)?

    i have some data like below(is json?),how to write them into
    the database?
    i user coldfusion 7.
    {"title":"ColdFusion?","url":"
    http://www.adobe.com/cfusion/"},
    {"title":"flex blogs","url":"
    http://www.flexblogs.com/"},
    {"title":"studio","url":"
    http://www.sans.com.com/"}
    Thank you very much!

    You need to parse it and then insert the records into your
    database.
    Take a look at
    CFJSON it is a JSON
    serialiser and de-serialiser.
    Once you have converted it to native CF datatypes you can
    loop through it and insert it into your database.

  • Mac Mini Sever - Public Share - how enable read and write permissions for new remote files

    Hi,
    this Sunday a friend ask me to help hum with a problem on is Man Mini Server. He has a small office and uses the mini server to share a public folder to all his employees.
    Everyone that creates a file, saves it to the public folder at the mini mac.
    That problem is that, who creates the file owns it and remains with read-only permissions to everyone else. The owner has to change the file permission in order to the rest of the employees can work on it.
    I do not know mac arquitecture, I only work with windows and linux, but i suspect the principles are the same.
    We try to create another folder , and share it, but it happens the same. Have you any ideas on what is wrong?
    I suspect it has anything to do with de file Sharing at the mini mac, but it has read and write permissions for everyone.
    Thanks for your help.

    signed applet. You aren't going to find any easy way to distribute that policy file to users, and that policy file, if you asked me to put it on my PC, I'd tell you to take a flying leap. That would open any applet to access.

  • How to read and save the following XML-Doc?

    Hi all,
    I have a XML-Document:
    <root>
    <employees>
    <emp1>
    <ename>Test1</ename>
    <empno>1</empno>
    <sal/>
    <ord>
    <item>1</item>
    </ord>
    </emp1>
    <emp2>
    <ename>Test2</ename>
    <empno>2</empno>
    <sal>1000</sal>
    <comm>200</comm>
    <ord>
    <item>3</item>
    </ord>
    </emp2>
    </employees>
    </root>
    This should I save in the databse table:
    CREATE TABLE XML_DOC
    ID NUMBER(38),
    FATHERTAG NUMBER(38),
    TAGNAME VARCHAR2(250),
    TAGCONT VARCHAR2(4000)
    And tha data should be saved in the following format:
    =======================================
    | ID | FATHERTAG | TAGNAME | TAGCONT|
    | 1 | | root | |
    | 2 | 1 | EMPLOYEES | |
    | 3 | 2 | EMP1 | |
    | 4 | 3 | ENAME | Test1 |
    | 5 | 3 | EMPNO | 1 |
    | 6 | 3 | SAL | |
    | 7 | 3 | ORD | |
    | 8 | 7 | ITEM | 1 |
    | 9 | 2 | EMP2 | |
    Has anyone any Idea how to realize it?
    Regards

    Leonid,
    Why don't you just store the xml document in the database as an xmltype? You could then build a view over the object-relational table to pull the data out into the format you want.
    The following code Example is from one of my favorite DBA's Johnathan Gennick and can be found at this link.
    http://www.oracle.com/technology/oramag/oracle/03-jan/o13xml.html
    CREATE VIEW cd_master (Title, Artist, Website, Description) AS
    SELECT extractValue(value(x),'/CD/Title'),
    extractValue(value(x),'/CD/Artist'),
    extractValue(value(x),'/CD/Website'),
    extractValue(value(x),'/CD/Description')
    FROM CD331_TAB x;

  • XML reader and get the value from another class

    Hello to all, I have stupid question.
    I have main.java and ConfigXML.java(read my config xml file).
    Code from ConfigXML.java
    NodeList flnamelist = flcon.getElementsByTagName("filename");
    Element flnameEL= (Element)flnamelist.item(0);
    NodeList flnameTEXT = flnameEL.getChildNodes();
    String alsl = ((Node)flnameTEXT.item(0)).getNodeValue().trim();How I can get String alsl = ((Node)flnameTEXT.item(0)).getNodeValue().trim(); from my ConfigXML.java to main.java.
    Sorry for my bad english

    public class ConfigXML {
      private String alsl;
      // constructor goes here if necessary
      public void parse() {
        // something
        NodeList flnamelist = flcon.getElementsByTagName("filename");
        Element flnameEL= (Element)flnamelist.item(0);
        NodeList flnameTEXT = flnameEL.getChildNodes();
        alsl = ((Node)flnameTEXT.item(0)).getNodeValue().trim();
        // Notice that we assigned the data to an instance variable
      public String getAlsl() {
        return alsl;
    public class Main {
      // That's a really terrible name but at least let's capitalize it so it's standard
      public static void main(String[] args) {
        ConfigXML config = new ConfigXML();
        config.parse();
        String answer = config.getAlsl();
    }

  • How to read and store the documents from other system to own system.

    Hi Experts,
    i need to read the document from other system (Say from other connected R/3 system) and then i need to save it in my system.
                     Please suggest how would i proceed?
    Any helpful suggestion will be rewarded with points.
    thanks
    Snehasish

    Hi Abaper
    I think I havent explained my problem well. Here I am explaining it again..
    I want to pull an  *.excel/ *.csv file through ABAP code.The target file that I want to access in my ABAP code is stored into another PC in the same Local area network under some directory say 'c:\temp\credit.csv'.
    I have the logon information of the target file's  PC.
    Please help me with code if anyone of you having.
    Thanks in advance.
    Rgds,
    Snehasish
    Edited by: Snehasish Das on Apr 29, 2008 2:18 PM
    Edited by: Snehasish Das on Apr 29, 2008 2:33 PM

Maybe you are looking for

  • Download total BSP

    how to download the BSP page? i would like to download total BSP page contents.

  • Pan image

    ok i think what im loking for is some type of pan. What i mean is my projects runtime is 60 seconds and in my project i have a few still images and a few motion clips, from a far when u first look at if you see the whole project on your TV, what im t

  • Warning while deploying Process Flow

    Hi All, When I try to deploy my process flow it give me following warning: PRE-02212: Database link 'WB_LK_HD_PK' is a 'Fixed Name'. This could consider a security risk as it exposes username and password of the target user. PRE-02213: Database name

  • Script Error when starting Crystal Application

    Post Author: jhartney CA Forum: General Anybody seen this?  Just started when opening any report, been working fine for over a week and now this error.  Does not seem to harm anything, the reports still regenerate just fine.  Only happens when starti

  • Slow FCP7 Startup on Brand New Install

    I had a problem with corrupted .mov files exported and just generally being slogged down by the beachball of death in motion & on the FCP timeline. So, I erased the system hard drive and reinstalled from scratch. The only things installed are FCP7 an