Properties does have getProperty method

I have this code but the Properties does have the method getProperty()
import java.io.*;
import java.sql.*;
import java.util.*;
public class TestCode {
    static final String PROPERTY_FILE="JDBC-ODBC Driver.properties";
    String driverName, url, user, password;
    /** Creates a new instance of TestCode */
    public void access() {
        try{
            /* Create an object of the Properties class and load properties. */
            Properties prop=new Properties();
            prop.load(new FileInputStream(PROPERTY_FILE));           
            driverName=prop.getProperty("driver");  // Retrieve driver information.           
            url=prop.getProperty("url");    // Retrieve JDBC URL.
            user=prop.getProperty("user");  // Retrieve user name.
            password=prop.getProperty("password");  // Retrieve password.
            /* Initialize and load a driver. */           
            Class.forName("driverName");
            /* Establish a connection with a database. */
            Connection con=DriverManager.getConnection(url,user,password);
            /* Create Statement object. */
            Statement stmt=con.createStatement();
            /* Executes a SQL query to retrieve a ResultSet. */
            ResultSet rs=stmt.executeQuery("SELECT * FROM Registered_Users_Information");
            /* Iterate through the ResultSet to display data. */
            while(rs.next()){
                System.out.println(rs.getString("UserName"));
                System.out.println(rs.getString("Password"));
            con.close();
        }catch(Exception ex){
            ex.printStackTrace();
    public static void main(String args[]){
        TestCode t=new TestCode();
        t.access();
}Please show me the problem.
Thanks.
Nguyen_Tom

I used this code but it does not exist. Has anyone
tell me why or please five me an advise? The object
prop does not has the method load.
Properties prop=new Properties();
prop.load(new FileInputStream(PROPERTY_FILE));Thanks a lot.
Nguyen_TomRefer to the JDK spec since 1.0, Properties should have all the methods you said you didn't have.
Did your program throw any error messages?? Could you show me?
:D

Similar Messages

  • Error message: $host does not have a method 'resetDataPermsCheck'

    LiveCycle Designer 8.05.
    I am trying to reset the data in a subform. It is working great in certain subforms in my form. However, some of the code is as follows:
    if (form1.P1.docSF.new_revision.rawValue == "0") {
    // do something
    } else {
    xfa.host.resetData("form1.P1.newdoc_numberSF");
    With this code, I receive an error (in the Warnings panel) that says "$host does not have a method 'resetDataPermsCheck'", yet the subform fields still reset properly. If I move the "xfa.host.resetData..." line out of the "else" section into the "if" section, the error message goes away.
    Any idea what might be going on?

    Welcome to the forum.
    Could someone point to the cause of the error.Could you please mention the complete error message ( the ORA-xxxxx code ) and your database version ( the result of: select * from v$version; )

  • Help with Error: $host does not have a method 'messageBox'

    Greetings Everyone:
    I get this error in my Log window:
    Error: $host does not have a method 'messageBox'
    I'm calling xfa.host.messageBox("MyMessage") from form's initialize event.
    What am I doing wroing?
    Acrobat Pro 9 - Java Script is enabled.
    Thanks in advance,
    iL

    Hi Steve:
    Thanks for your prompt responses. I appreicate that. I got the latest version.
    I'm OT on at home looking for more answers...I'm guessing it's an installation issue...
    I even tried console.println("Message"); CTRL + J and blank. I did this on Acrobat and LC.
    I'm gonna do a full unistnall and reinstall when I get back to office.
    The software is coming from our IS dept so I know it's squeaky clean.
    I did an Installer Repair but the problem has returned.
    I also can't use/access any xfa.layout memebers....
    I get this errors even on newly created forms...it hasn't crashed again so I can't get any bucket ID log yet.
    Here's whats on my office box that giving me grief:
    LC version 8.2.1.4029.1.523496
    Acrobat Pro 9
    Java Version 6 Update 15
    OS Platform: (HP Box)
    SQL Server 2008 Express (HotFix installed)
    VS2008,Office2k7.
    XP SP3
    iL

  • Re: Error: $host does not have a method 'messageBox'

    Hello Experts:
    I'm experiencing strange behavior on my LC Designer ES application.
    I recieve a warning and my console window (ctrl+j) doesn't show up nor does the message box.
    I cannot see xfa.layout members on the object drop-down menu. I have re-installed to no avail.
    This occurs on every all forms. The default script is set to JavaScript.
    Can anyone explain this behavior.  Is it an installation issue?
    Thank you for your time, iL.
    Log:
    Generating PDF Document...
    Script failed (language is javascript; context is xfa[0].form[0].form1[0])
    script = xfa.host.messageBox("My Message");
      Error: $host does not have a method 'messageBox'
    PDF generated successfully.
    Script:
    form1::initialize - (JavaScript, client)
         xfa.host.messageBox("My Message");
    System Info:
    LC version 8.2.1.4029.1.523496
    Acrobat Pro 9
    Java Version 6 Update 15
    SQL Server 2008 Express (HotFix installed)
    XP SP3, Office 2k7

    Hi Steve:
    Thanks for your prompt responses. I appreicate that. I got the latest version.
    I'm OT on at home looking for more answers...I'm guessing it's an installation issue...
    I even tried console.println("Message"); CTRL + J and blank. I did this on Acrobat and LC.
    I'm gonna do a full unistnall and reinstall when I get back to office.
    The software is coming from our IS dept so I know it's squeaky clean.
    I did an Installer Repair but the problem has returned.
    I also can't use/access any xfa.layout memebers....
    I get this errors even on newly created forms...it hasn't crashed again so I can't get any bucket ID log yet.
    Here's whats on my office box that giving me grief:
    LC version 8.2.1.4029.1.523496
    Acrobat Pro 9
    Java Version 6 Update 15
    OS Platform: (HP Box)
    SQL Server 2008 Express (HotFix installed)
    VS2008,Office2k7.
    XP SP3
    iL

  • Why does not JButton have processActionEvent method, unlike Button ?

    java.awt.Button has processActionEvent( ActionEvent e) method which ( as i think ) calls actionPerformed(e) of the registered listeners.
    Why does not javax.swing.JButton have this method ? from where and how is actionPerformed() of JButton called ?
    I want to know how exactly this event is handled ?
    Thanks in advance.

    eng.robo wrote:
    java.awt.Button has processActionEvent( ActionEvent e) method which ( as i think ) calls actionPerformed(e) of the registered listeners.
    Why does not javax.swing.JButton have this method ? from where and how is actionPerformed() of JButton called ?Swing and AWT are very different and you should not expect one to have the methods of the other.
    I want to know how exactly this event is handled ?Have you read the JButton section in the Sun Swing tutorial? This will tell you much. To see exactly how actions are handled in JButtons, I suggest that you open and look through the source code for the AbstractButton and DefaultButtonModel classes.

  • Why Set does not have get() method

    Can some one tell me why set does not have get method?...

    user12203354 wrote:
    ya u are right that designer of this class thought there is no implementation required for get but why he/she thought like this...
    there must be some valid reason for the same.Because a Set's purpose is not to keep things in order; it's to ensure there are no duplicate entries. Set would require extra code to be able to keep track of an order.
    Note that there is a Set implementation that does keep track of insertion order--LinkedHashSet--but it doesn't have a get() method.

  • Why IVisualElementContainer does not have "getChildren" method defined?

    Hi all,
    In Flex 3 SDK Container.as has method getChildren() and rawChildren property typed as IChildList.
    But In Flex 4 the interface IVisualElementContainer does not have a definition for getChildren() > thus neither SkinnableContainer nor Group have this method defined.
    Was this decision made deliberately to simplify the interface API?
    I find it convenient to have "getChildren" method implemented inside Group and SkinnableContainer,  for example this can be useful if I want to access all visual childs of those containers to pass them along to some manager class or to dynamically set some common property of all childs ( e.g visibility).

    MX had a concept of two sets of children: regular children and raw children.  One component could have two children lists.
    Spark simplifies this concept because of the skin.  Now there's really only one set of children.  Because of this IVisualElementContainer acts like IChildList and has a very similar API.  You should be able to use IVisualElementContainer as you would IChildList before.
    Note that in places where we do have more than one-set of children, we don't expose them on the main object, but require you to dig down in to the separate object (the skin or the controlBarGroup for example).
    Hope that helps,
    Ryan

  • Error while accessing secure store: File "SecStore.properties" does not exi

    Hi ,
    I have a java desktop application, and i am trying to get a connection from a datasource deployed on one SAP AS Java, I can get the datasource succsfullly but when i try to get a connection from the DS, it throughs this exception, I put the secstore..properties file in the classpath even after that it is not happy,
    any solution/hint/light please!!!!
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "SecStore.properties" does not exist although it should..
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
         at com.sap.customcode.ConflictingActionFixture.(ConflictingActionFixture.java:53)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at fit.FixtureClass.newInstance(Unknown Source)
         at fit.FixtureLoader.instantiateFixture(Unknown Source)
         at fit.FixtureLoader.instantiateFirstValidFixtureClass(Unknown Source)
         at fit.FixtureLoader.disgraceThenLoad(Unknown Source)
         at fit.Fixture.loadFixture(Unknown Source)
         at fit.Fixture.getLinkedFixtureWithArgs(Unknown Source)
         at fit.Fixture.doTables(Unknown Source)
         at fit.FitServer.process(Unknown Source)
         at fit.FitServer.run(Unknown Source)
         at fit.FitServer.main(Unknown Source)
    Caused by: com.sap.security.core.server.secstorefs.FileMissingException: File "SecStore.properties" does not exist although it should.
         at com.sap.security.core.server.secstorefs.StorageHandler.openExistingStore(StorageHandler.java:372)
         at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1946)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:802)
         at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:783)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:209)
         ... 18 more
    caused by

    the SecStore.key file was not there, I changed the passwd and checked the 'Encryption' on, after that my sever instance is not starting.
    Any idea?
    -Puneet

  • Crystal 2011 RAS. Section Expert Paging tab properties does not correspond to EnableNewPageAfter, EnableNewPageBefore properties in section format

    Hello,
    We have application where you can select fields, select groupings and properties (for example disable page grouping ) and create custom report.
    It worked with crystal 9.
    Now we are converting to Crystal 2011 and I have the following problem:
    I create report dynamically and set group footer EnableNewPageAfter property to false in group footer section.
    When report is created , I open it and see that New Page After property in section expert is unchecked.
    When I run the report, I have page break after each group - which is wrong.
    If I open report in Crystal, check New Page After Property , save, exit report, open report again, uncheck New Page After Property, save and exit,And than run the report again,
    My report behaves correctly:does not break after each group.
    If I open report in Crystal, check New Page After Property , save, exit report and then load this report in code and look at EnableNewPageAfter property,
    the property is still false - but it should be true
    Do I use the wrong property?
    What is the right RAS property to set  Crystal report 'New Page After' Property in the code for group footer/group header?
    Below is method that sets properties for section.
    All properties from common tab works, but paging tab properties does not work
    public static void SetSectionSettings( ReportSectionController reportSectionController, Section section, Color backgroundColor, bool enableKeepTogether, bool enableNewPageAfter,
                                                bool enableNewPageBefore, bool enablePrintAtBottomOfPage, bool enableResetPageNumberAfter, bool enableSuppress, bool enableSuppressIfBlank,
                                                bool enableUnderlaySection, bool autoFitSection )
                try
                    SectionFormat sectionFormat = new SectionFormat();
                    sectionFormat.EnableKeepTogether = enableKeepTogether;
                    sectionFormat.EnableNewPageAfter = enableNewPageAfter;
                    sectionFormat.EnableNewPageBefore = enableNewPageBefore;
                    sectionFormat.EnablePrintAtBottomOfPage = enablePrintAtBottomOfPage;
                    sectionFormat.EnableResetPageNumberAfter = enableResetPageNumberAfter;
                    sectionFormat.EnableSuppress = enableSuppress;
                    sectionFormat.EnableSuppressIfBlank = enableSuppressIfBlank;
                    sectionFormat.EnableUnderlaySection = enableUnderlaySection;
                    sectionFormat.BackgroundColor = uint.Parse( ColorTranslator.ToWin32( backgroundColor ).ToString() );
                    reportSectionController.SetProperty( section, CrReportSectionPropertyEnum.crReportSectionPropertyFormat, sectionFormat );
                catch ( Exception ex )
                    log.Error( "ReportApplicationBuilder error - SetSectionSettings: ", ex );
                    throw;
    Thanks,
    Julia Klubis

    Hi Julia,
    There have been a few escalations of this type. For some odd reason you have to call the .Set 2 times...
    reportSectionController.SetProperty( section, CrReportSectionPropertyEnum.crReportSectionPropertyFormat, sectionFormat );
    reportSectionController.SetProperty( section, CrReportSectionPropertyEnum.crReportSectionPropertyFormat, sectionFormat );
    See if that works?
    Don

  • How to return multiple values from a getProperty method

    Hi All,
    Even though I understand that getPropprty can return only one value. I just have a doubt. Is it possible to use a getProperty method of a bean like
    public String getemp_Info(){
    return emp_Id;
    return emp_Name;
    }also can any one explain me where and how to use private variables and public variables in a bean.
    R.Ramesh.

    I already have it I just wanted to know that is there any usage like the one I asked, anyway thanks for your suggestion.
    I have already used another getProperty method as balusc quoted.

  • Error in Integration Repository: ..SecStore.properties does not exist

    Hi Guys!
    I'm getting this error when I try to tick and save the values "Objects Are Original Objects" and "Objects Are Modifiable" in a software component version in the Integration Repository:
    "ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "
    <hostname>\sapmnt\XIP\SYS\global\security\data\SecStore.properties" does not exist although it should.."
    Would any of you know what might be wrong?
    I'm using PI 7.0.
    Warm Regards,
    Glenn

    Is your XI installed on SQL Server? Seems like there is a db connection error woth XI to the underlying database.
    Check if the DB instance is running.
    VJ

  • File's Owner does not show methods in Interface Builder 3.2.6 but the class is set correctly and the nib on the lower left is green

    Hi, I'm trying to make my first IPhone app. After having problems with interface builder the first time I coppied the code directly from a tutorial in case I made any mistakes. I saved the program, and re-opened the .xib file. Right clicking  File's Owner does not show a list of methods. I've been looking around for solutions for this but have not gotten anything to work. I tried deleting the default .xib and creating a new one through file-> new file. This did not help. I did notice that File's owner was showing up as a light blue cube apposed to a yellow one now and found that a bit odd but otherwise nothing changed. I opened the library menu and selected helloWorldiPhoneViewController so it would show up in the view port. I set the class field of File's Owner to hellowWorldiPhoneViewController. File's Owner still does not show methods when right clicked or when a line is dragged over a button. I read somewhere that the color of nib on the lower left of the viewport may indicate a problem, but it is green not indicating any issue. Every solution I found for someone else seems nto to work for me and I don't know how to continue.
    here is the .h file just in case:
    //  HelloWorldViewController.h
    //  HelloWorld
    //  Created by Paul Peelen on 2011-03-14.
    //  Copyright 2011 9697271014. All rights reserved.
    #import <UIKit/UIKit.h>
    @interface HelloWorldViewController : UIViewController {
            UILabel *textLabel;
    @property (nonatomic, retain) IBOutlet UILabel *textLabel;
    - (IBAction)changeTheTextOfTheLabel;
    @end
    I'm trying to connect changeTheTextOfTheLabel to a button and textLabel to a label

    You need a parameter for an interface builder method. The type should be id and the name is typically "sender". It would look like this:
    - (IBAction)changeTheTextOfTheLabel: (id) sender;
    Be careful about those tutorials. Many are ancient and do not correspond to current Xcode behaviour.

  • HT4914 How does the payment method work for iTunes Match?

    How does the payment method work with iTunes Match. For example, if you have a gift card, does it take it out of that. Or is there tax? What if you cancel your subscription in the middle of the year, does it take the money for that year or not? If someone could answer those questions it would be greatly apreciated. And if anyone has their own questions, feel free to ask. Thank you.

    Hi HLFrank,
    Welcome to Adobe Forum,
    You can opt for monthly payment in a yearly contract or pay at one go for an year.
    Please check the option at http://www.adobe.com/in/products/creativecloud/buying-guide.html
    Regards,
    Rajshree

  • Working of serializable interface, when it doesn't have any methods

    Hi,
    I am curious about how the serializable interface is used in JVM.
    This is an empty interface. ie. it does not have any method signatures or any variables inside.
    How does java use this interface, for serializing purposes.
    Also, why should it be an interface, when its all empty.

    Such marker interfaces are just used to tell something about about a class, in this cases that the developer wants that instances of a class can be serialized. The code that handles the serialization just check s"instanceof Serializable". Of course Serializbale could look like this
    public interface Serializable
    public boolean isSerializable();
    But why make things more complicated than necessary?

  • What is doing DCExecutableBinding isRefreshed() method?

    Hi,
    I would like to know what is doing DCExecutableBinding isRefreshed() method.
    http://docs.oracle.com/cd/E15051_01/apirefs.1111/e10653/oracle/adf/model/binding/DCExecutableBinding.html#isRefreshed%28%29
    More precisely, I have a DCIteratorBinding, and I whant to know when isRefreshed() method will return true. Why with some iterators I got true sometimes, and why with other I got false all the time?
    Edited by: h0s on 9 déc. 2011 08:18

    We have a UIShell based on Steven Davelaar UIShell :
    http://blogs.oracle.com/jheadstart/entry/core_adf11_uishell_with_dynamic
    If I ask this, it is beacause of a different behavior in "Marking Tab Dirty" functionality.
    I try to understand why in some taskFlows it works fine, and why in other, I have DCIteratorBinding .isRefreshed() always returning false.
    Can you say me when isRefreshed() method will return true?

Maybe you are looking for