Loading the final static variables at run time.. Please help

Hello, fellow developers & Gurus,
Please help me figure out the best way to do this:
I need to load all my constants at run time. These are the public static final instance variables. The variables values are in the DataBase. How do I go about loading them.

Your original question was diffeent, but your further posts show what you really want to do:
1) all constants in 1 class
2) available readonly for other classes
3) updatable during runtime by changing in the database
Did I understand you right?
Then smiths' approach solves point 2):
Instead, make the variables available through a method
call - that way you avoid the whole final variable
versus read-only attributes problem.
//GLOBAL VARIABLES EXPOSED AS PUBLIC PROPERTIES
public final class GlobalProperties
public static int getTableSize();
public static int getRowSize();
Each "constant" should be a private static variable, and these methods simply return their values.
The variables are initialized in a static initializer by accessing the db. Ok.
You habe a table with one row containing as columns all the constants.
A method readConstants() does a "select constant1, constant2, ... from const_table" and sets all the variables.
The static initializer calls this method.
Right?
Ok, then you simply call readConstants() everytime you want to synchronize with the actual content of const_table.
Was it this?

Similar Messages

  • Load a variable at run time

    I have the following code to load in some images and
    display/move them:
    this.createClassObject(mx.controls.Loader, "myLoader", 1);
    this.createClassObject(mx.controls.Loader, "myLoader2", 2);
    this.createClassObject(mx.controls.Loader, "myLoader3", 3);
    this.createClassObject(mx.controls.Loader, "myLoader4", 4);
    this.createClassObject(mx.controls.Loader, "myLoader5", 5);
    myLoader.scaleContent = false;
    myLoader2.scaleContent = false;
    myLoader3.scaleContent = false;
    myLoader4.scaleContent = false;
    myLoader5.scaleContent = false;
    var images:Array = ["
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg"
    myLoader.contentPath = images[0];
    myLoader._x = 0;
    myLoader._y = 0;
    myLoader2.contentPath = images[1];
    myLoader2._x = 320;
    myLoader2._y = 0;
    myLoader3.contentPath = images[2];
    myLoader3._x = 640;
    myLoader3._y = 0;
    myLoader4.contentPath = images[3];
    myLoader4._x = 960;
    myLoader4._y = 0;
    myLoader5.contentPath = images[4];
    myLoader5._x = 1280;
    myLoader5._y = 0;
    This works great, but what I'm wondering is, can I load in
    the images array variable at run time from an external file so I
    could edit that file on the server in order to change images,
    without having to re-publish the flash file? Thanks for any help.
    Bob

    Adrian,
    Have a look at: http://www.oracle.com/technology/products/database/htmldb/howtos/howto_create_upload_spreadsheet_form.html
    It's not 100% what you're looking for (as it requires you to cut & paste from the spreadsheet), but it may do what you're after.
    Thanks,
    - Scott -

  • It takes long time to load the parameter's value when running we run report

    Hi,
    It takes long time to load the parameter's value when running we run report. What could cause this? How to troubleshoot the behavior of the report? Could I use Profile and what events should i select?
    Thanks

    Hi jori5,
    Based on my understanding, after changing the parameter, the report render very slow, right?
    In Reporting Service, the total time to generate a report include TimeDataRetreval, TimeProcessing and TimeRendering. To analyze which section take much time, we can check the table Executionlog3 in the ReportServer database. For more information, please
    refer to this article:
    More tips to improve performance of SSRS reports.
    In your scenario, since you mention the query spends less time, the delay might happens during report processing and report rendering section. So you should check Executionlog3 to check which section costs most of time, then you can refer to this article
    to optimize your report:
    Troubleshooting Reports: Report Performance.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • Exporting DI batch to BAT and set DI parameter/variable at run time

    Hi All,
    We are looking to call DI batch job externally and pass parameter/variable at run time.
    We tried exporting DI batch to a bat file and setting substitution parameters during export.
    In the exported .bat file, it references a .txt file which shows the name of the substitution paramemters but the value of the parameters are encrypted.
    Does anyone know how to pass parameter/variable to a DI batch job at run time externally?
    Thanks,
    Bobby

    I tried out this method and I have some additional issues.
    1. if we use the BOE scheduler the text parameter file is using a specific naming convention that is not clearly documented. it is like : -GV"$VAR=ENCRYPTEDVALUE;"... trying to modify it with a clear value like -GV"$VAR=MYVALUE;" was simply ignored by the scheduler... seems also that BOE did not sent any scheduling request to the DI Job Launcher...
    What is the proper convention please?
    2.Is there a better way to enter this parameter than editing the TXT file. Most of the BOE InfoView users are not allowed to modify or store documents.. This is not very convenient if they cannot enter simply the parameter values in a let say more confortable way...
    Thank you and cheers

  • Bind variables at run time

    We have a view object with LOV, this LOV has a bind variable. How can we set this bind variable at run time through this view object?

    Hi bara,
    1. Wat you ve to do is create a transient attribute in the child entity.
    2. Create an association between master and child.
    3. The value should be a groovy expression such that it refers the field in master table which needs to be passed to the LOV.
    4. Add the transient attribute in ViewObject also.
    4. Use ViewAccessors and map the transient attribute to the bind variable in the List View Object
    Regds,
    Srinidhi

  • I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.

    I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.

    See:
    * http://kb.mozillazine.org/Recovering_a_missing_profile
    * http://kb.mozillazine.org/Profile_in_use
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • I have a problem with the touchsmart 420pc, after a running time (2 hour approx) is turned off,

    good afternoon, I have a problem with the touchsmart 420pc, after a running time (2 hour approx) is turned off, probably warming, but this rare, is suddenly going slow parapadear and image.
    also sounds like when damaged ballasts for lamps,
    ANYONE know what could be the cuasa and / or what is causing this.
    greetings and thanks in advance

    Hi,
    Please write your TouchSmart model number, which system are you using and country of purchase.
    Resource:
    How Do I Find My Model Number?
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

  • HT201413 I am running Windows 7, ITUNES 10.6.3.25.  I am unable to see my Iphone/sync my iphone in Itunes.  I have uninstalled all components of Itunes and downloaded the newest version to no avail.  Please help.....Thanks

    I am running Windows 7, ITUNES 10.6.3.25.  I am unable to see my Iphone/sync my iphone in Itunes.  I have uninstalled all components of Itunes and downloaded the newest version to no avail.  Please help.....Thanks 
    I am attaching the Diagnostics data below:
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
    Dell Inc. Inspiron N7010
    iTunes 10.6.3.25
    QuickTime not available
    FairPlay 1.14.43
    Apple Application Support 2.1.9
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 5.2.0.6
    Apple Mobile Device Driver 1.59.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 0016AA9C0126E318
    Current user is not an administrator.
    The current local date and time is 2012-07-05 11:42:18.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Intel(R) HD Graphics
    **** External Plug-ins Information ****
    No external plug-ins installed.
    **** Device Connectivity Tests ****
    iPodService 10.6.3.25 (x64) is currently running.
    iTunesHelper 10.6.3.25 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B34.  Device is working properly.
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B3C.  Device is working properly.
    No FireWire (IEEE 1394) Host Controller found.
    Most Recent Devices Not Currently Connected:
    iPod (5th generation) running firmware version 1.3
    Serial Number:       8L643QK9V9R
    iPhone 4 (CDMA) running firmware version 5.1.1
    Serial Number:       C8RG57F0DDP8
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.

    I did all that HT1925 recommended and it was no help.  My computer still won't recognize my iPhone.  Often trying to start Apple Mobile Device Service fails with an error message that it starts and then stops immediately.

  • Why is it that my iMovie app keeps shutting off randomly! I'm trying to export my movie and it shuts down each time it's a 1/4 of the way through downloading! Ah! Please help.

    Why is it that my iMovie app keeps shutting off randomly! I'm trying to export my movie and it shuts down each time it's a 1/4 of the way through downloading! Ah! Please help.

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • HT4623 i disconnected my iphone 4 while it was updating and now its frozen, the screen is showing a apple logo and a loading bar which has been for 9hrs now. please help

    i disconnected my iphone 4 while it was updating and now its frozen, the screen is showing a apple logo and a loading bar which has been for 9hrs now. please help

    It's not uncommon for it to not work the first time and sometimes, you have to try it a few times. Turn off your antivirus software and your firewall while you are trying to restore the iPad. Enable them again after you restore.
    If that still won't work, post back with detailed information as to what exactly does happen as you go through the process.

  • HT5624 My wife and I share the same apple id, we just updated our iphones. When we were asked if we wanted to share the same apple id for icloud we said yes, now our phones can't face time, please help?

    My wife and I share the same apple id, we just updated our iphones. When we were asked if we wanted to share the same apple id for icloud we said yes, now our phones can't face time, please help?

    Read http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    If you wish to share an Apple ID with family members then read: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/

  • Hi can you please help me to fix my iPhone 5 when I update it to the iOS 6.1.2 my carrier signal indicator states searching all the time please help me what to do

    HiHi can you please help me to fix my iPhone 5 when I update it to the iOS 6.1.2 my carrier signal indicator states searching all the time please help me what to do

    Hi Samantha,
    Are you aware that if you restore your ipad that you will lose all data from your ipad and very difficult to get it back unless you had previously made a back-up of your data on itunes or in the cloud. and that would be on the computer you set those up on. (There are some independent apps out there that might help restore data but I don't have any experience with them...)
    Also, I think if you restore on another computer you're supposed to have administrator rights and have the latest itunes update. And I think if you sync (if restoring is considered syncing with another computer, you'll be locked out of your computer or a new one.)
    I don't know if there is a way for you to safely eject your ipad from your mom's laptop and find another way, but please read this
    http://support.apple.com/kb/ts1275
    Also, I suggest you start a new post and title it something like First, stuck on update and now on Restore on another computer. Please HELP! And then tell the story of your problem that you originally included and your follow-up efforts to restore given a suggestion on previous post (though I think you SHOULD AVOID RSTORE if you can.) And refer them to your original post
    https://discussions.apple.com/message/22050045?ac_cid=tw123456#22050045
    Hope this helps and if you can get back to your ios before the upgrade, stay with it. I hope it all works out for you.
    FYI - If it's a new or refurb bought within the past year you might be able to have it replaced by Apple.

  • My iPHONE 5 wifi is NOT working when am 3 feet away from router while my iPhone 4s has full signal all the time.Please help.

    My iPHONE 5 wifi is NOT working when am 3 feet away from router while my iPhone 4s has full signal all the time.Please help.

    The problem would seem to be in the firewall in your router.  Have you tried disabling it? I assume you've updated the router firmware, right?  Consider bypassing the ISP provided router (using it as a modem only) and unsing another device such as an Aiport Express.

  • My ipad 1 loses wifi connections when it goes to sllep. have to go into settings to reconnect. Does this all the time. please help.

    my ipad 1 loses wifi connections when it goes to sleep. have to go into settings to reconnect. Does this all the time. please help.

    my ipad 1 loses wifi connections when it goes to sleep. have to go into settings to reconnect. Does this all the time. please help.

  • I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after and extended period of time please help

    I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after an extended period of time please help.  Thanks!

    I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after an extended period of time please help.  Thanks!

Maybe you are looking for