How to detect which development environment I'm in (J2EE app)

I need a way to tell which development environment I'm in (dev, test, uat, prod). How is this accomplished. The app is a Java web app, running on WebSphere. I'm more of a pure programmer, so I'm not so well versed in architecture/framework.
Thanks!
-Nathan

I want the front-end to be able to tell.
I think I may have found an acceptable solution. I found an Oracle function that I can use that will return to me which db environment I'm in:
FUNCTION GET_INSTANCE_NAME RETURN VARCHAR2
IS
the_instance_name VARCHAR2(512);
BEGIN
-- This is an alternate method of getting the same info:
-- SELECT property_value FROM database_properties WHERE property_name = 'GLOBAL_DB_NAME';
select sys_context('userenv','db_name') INTO the_instance_name from dual;
RETURN the_instance_name;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END GET_INSTANCE_NAME;

Similar Messages

  • How to detect which data type is passed in ?

    Hello!
     I've built a VI function. But I want to make it more secure - that function could detect which data type is wired to the inputs and allow wiring only certain data types. How can I do this?
     Thanks
    Message Edited by ACiDuser on 05-23-2009 08:13 PM
    Solved!
    Go to Solution.

    I'm assuming you're talking about numeric datatypes. In this case that information is not available to you at the subVI level. The LabVIEW compiler will have already changed the datatype to match what your subVI expects if someone wires something of a different type.
    You could use a variant as your input. Then in the subVI you can use the Variant to Flattened Data to get the type. The OpenG LabVIEW Data Tools VIs will be useful if returning an enum specifying the datatype. Specifically, using the "Get TDEnum From Data VI".
    Now that we've gotten that out of the way, let's talk about the why. Why do you need to do this? What are you trying to "secure"?

  • How to detect which Anti Virus is installed?

    I want to know how can I detect which anti virus is installed on the system using C#?
    Jassim Rahma

    You can use WMI to query this information.  The code to do so would work like this:
    ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"root\SecurityCenter2", "SELECT * FROM AntiVirusProduct");
    ManagementObjectCollection result = searcher.Get();
    if (result.Count > 0)
        foreach (ManagementObject item in result)
            Console.WriteLine("Your computer is protected by: {0}", item["displayName"]);
    else
        Console.WriteLine("Your computer is not protected!");
    Note that the location on that first line might be "root\SecurityCenter" on some systems.  It might be best to run this portion of code for both "root\SecurityCenter" and "root\SecurityCenter2".
    Coding Light - Illuminated Ideas and Algorithms in Software
    Coding Light Wiki • LinkedIn • ForumsBrowser

  • How to detect which application connects to the in...

    Hello,
    I have a E71 and for a week or so the phone drains the battery quite fast.
    I have seen in the journal that an wi-fi connection is opening every 2-3 minuntes for less the half a minute.
    The weird thing is that the WLAN is disconected and WLAN SCAN is OFF, but the icon that shows a wi-fi connection appaers every 2-3 minutes.
    So how to detect the damn application that makes wi-fi conections by my back?
    Thanks!

    Check messaging and social media apps connection and sync settings.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • How to detect which applications that are currently running

    Hi there. Is there a way to detect which applications that are currently running on my machine? Is there a class that can get all of the running applications, you know, like the taskmanager.
    //peter

    What you are asking for is indeed not possible through "100% Pure Java," because each operating system that runs Java Virtual Machines can handle the running processes differently (think about the differences between a process scheduler for, say, Windows NT and your Palm Pilot, both of which could have a JVM running).
    That means there are essentially 2 avenues to persue for this:
    1. Use an external "user-level" command (like ps on a UNIX-like OS) and parse the results (this is what people are referring to when they say "Runtime.exec()". There have been some nice exec() frameworks posted around here before, so I'd recommend searching around a bit for more info.
    I also found this link (from Google) which apparently shows the javadocs where someone has attempted something similarly on the Linux platform before...that's all I know about it:
    http://www.cougaar.org/software/9.2/javadoc/api/org/cougaar/tools/server/system/linux/LinuxProcessStatusReader.html
    2. Use a JNI (Java Native Interface) call to an externally provided C function to get the info you need. Here's a link to the Java 1.4 JNI information:
    http://java.sun.com/j2se/1.4/docs/guide/jni/
    Hope this helps! (But it's not going to be a quick and easy problem to work with)...
    -J

  • How to detect which class caused missing plug-in alert?

    Hi,
    I have a plug-in with the bellowing class definition, there is no any customized persist class.
    resource ClassDescriptionTable(kSDKDefClassDescriptionTableResourceID)
              Class
                        kMyActionComponentBoss,
                        kInvalidClass,
                                  IID_IACTIONCOMPONENT, kMyActionComponentImpl,
                                  IID_IPMPERSIST, kPMPersistImpl
              Class
                        kMyDialogBoss,
                        kDialogBoss,
                                  IID_IDIALOGCONTROLLER, kMyDialogControllerImpl,
                                  IID_IOBSERVER, kMyDialogObserverImpl,
    In programming guide it says "If your plug-in does not store data in documents, you do not need to take any special precautions" in section "Guidelines for handling a missing plug-in".
    However now, there may be missing plug-in message for this plug-in when open a document saved with this plug-in installed.
    My question is: is there any way to detect which class/implement caused the plug-in is required?
    I can get some info about missing plug-in from IContentMgr, but there is no info about the detail classes.
    Any idea?
    Thanks,
    Aidy

    Regarding global (or not) text adornments:
    An adornment is something attached to a larger entity, e.g. the various handles of page items, or additional marks within text.
    Some adornments are remembered individually per addressed entity (page item adornments are probably in IPageItemAdornmentList), while others (the global text adornment IGlobalTextAdornment) are just assumed to be there for all potential targets (all wax runs) and have no persistent footprint where the ITextAdornments do.
    For more details please refer to the documentation or just search the SDK.
    Dirk

  • How to detect which JVM is installed on a server

    Hi,
    Our company is using a robot to scan workstation to detect which soft is installed on machines
    We would like to have an idea of which JVM is installed on workstations. Our robot can detect filename, filesize, signature (properties).
    Where can I find for each JVM the filename to detect, its filesize and eventually the signature associated
    Many thanks in advance for your help

    To get the version of java type
    java -version
    From this you can build a set of signatures for each version. You may find you inventory program will allow you to run a script on the workstation in which case you can get the exact version automatically.

  • How to detect which physical drive a given file is on

    Given a file that exists, is there a way within Java to detect what physical drive that file is on? I don't care how that drive is denoted, as long as it is uniquely specified. This can be through a hard drive serial number, or any other way. The specifics of the drive do not matter, I only care about uniquely identifying physical drives. If it matters, I'd like to also be able to determine if said drive is a flash drive, however programmatically I won't care that it is a flash drive, just that it is a separate drive itself.
    If this isn't possible through Java, could someone point me in the direction of how to determine this through another language, possibly using JNI?

    mgolowka wrote:
    Given a file that exists, is there a way within Java to detect what physical drive that file is on?
    Check if this helps you, I'm not sure the effects when this is executed in a Unix based environment.
         public static void main(final String[] args) {
              final String fileName = "my_file.myext";
              final File file = new File(fileName);
              final File roots[] = File.listRoots();
              final String rootOfTheFile = file.getAbsolutePath().substring(0,
                        file.getAbsolutePath().indexOf(File.separator))
                        + File.separator;
              System.out.println("File is present in - " + rootOfTheFile);
              for (final File file2 : roots) {
                   System.out.println("Root in system - " + file2.getPath());
         }And the output for the code is as follows, of which Y and Z are network mapped drives.
    File is present in - D:\
    Root in system - C:\
    Root in system - D:\
    Root in system - E:\
    Root in system - F:\
    Root in system - Y:\
    Root in system - Z:\

  • How to detect which http server is used ?

    Hello
    I need a simple method to determine which http server is used on an existing APEX installation, amongst the 3 possible methods.
    Thanx

    In most cases its the URL that hints at what is behind the scenes.
    If you /pls/apex in all probability its Oracle HTTP Server with ModPLSQL
    If you see <hist>:8080 then chances are its EPG or OC4J
    If you see someother port, but not /pls/apex then chances are its ApexListener.
    A more accurate way is to run the command below from within Apex , either an application or SQLWorkshop
    select owa_util.GET_CGI_ENV('SERVER_SOFTWARE') from dualEPG Return Oracle Embedded PL/SQL Gateway/10.2.0.1.0 on XE
    Apex-Listener returns Mod-Apex
    Regards,
    Edited by: Prabodh on Aug 19, 2010 5:48 PM

  • How to detect which implementation JSF 2 (Myfaces or Mojarra) used in my Primefaces project?

    Hello.
    OS: [Windows 2008 R2, Win XP], JDK: 1.7.0_76, AS: GlassFish 4.0, IDE: Netbeans 7.4, JSF2: [ Mojarra 2.2.10, Myfaces 2.2.7], Primefaces: 5.1.
    1. I create & deploy web application, it use mojarra. Everything is good, run.
    2. In Netbeans I create Library for Myfaces-<version>.jar & dependence's jar. Include the Lib to project properties. Clean-Build project. Deploy to GlassFish. Everything is good, run.
    Does Glassfish use to execute Myfaces as implementation JSF 2? Or it run your installed Mojarra?
    Any help appreciable. Best regards.

    For Mojarra see the following blog entry
    https://weblogs.java.net/blog/mriem/archive/2013/12/04/jsf-tip-51-determine-what-version-mojarra-you-are-running
    Thanks!

  • How to detect which Oracle ODBC Driver is installed using VBA Excel

    Hi,
    I have an excel workbook containing database queries that uses an oracle ODBC driver to update data. However different machines have different versions of the ODBC drivers installed and so although the code works on my machine, it doesn't on others because the ODBC connection reference is different.
    So as a first step, I would like Excel to automatically find what ODBC drivers are installed when the macro is run so that I could dynamically change the ODBC connection reference depending on what drivers are installed.
    The connection strings relating to ODBC drivers are in following formats:
    Machine A: "ODBC;DRIVER={Oracle OraDb11g_home1}
    Machine B: "ODBC;DRIVER={Oracle in instantclient11_1}
    ETC
    All machine run windows XP.
    Alternatively would there be an easier way to connect to a shared orcale database without the need of installing any additional drivers?
    Thanks,
    Lucas

    Problem with Excel & ODBC drivers really has NOTHING to do with Oracle RDBMS.
    I suggest you tag your post as "Off Topic" & post it in some Excel forum instead.

  • How to detect which radio button is selected in Forms?

    I created a Form with two radio buttons, one for Male and one for Female.
    I created a Push Button with WHEN-BUTTON-PRESSED to display the selected radio button as a DIsplay Item on the same Form.
    Can any one give me some hints?
    (0) Male
    ( ) Female
    [Submit]
    When the [Submit] button is pressed, I would like to display:
    You are a man. (if Radio button selected is Male)
    You are a woman (if Radio button selected is Female)

    create item RG with property record group in block2
    add two button in this group (rg1 and rg2)
    assign value to above two buttons
    rg1 M (Male)
    rg2 F (Female)
    assign initial value to RG Say M
    You can use this item as :block2.RG in Save Button.

  • FTP to fieldpoint works in development environment but not in deployed app?

    I have developed a VI which employs FTP to upload data files created by another application
    embedded on a FieldPoint, not altogether unlike the "Redundant Datalogger" example VI found
    in the NI Developer Zone. Unlike that example, I am not employing DataSockets, Citadel
    database functionality or any other DSC functionality which I know or suspect does not work
    in a deployed application without the DSC Run-Time Engine.
    This VI works fine when I run it in the LabVIEW Development System (Full + RT + DSC), but
    when I deploy the VI as a standalone application FTP (at least) appears to quit working.
    I don't have the specific error code -- my VI re-interprets FTP errors to a novice-
    friendly "check the LAN connection and/or FieldPoint power" warning and I will have to
    modify the code to extract better diagnostics. I will also not be able to probe further
    until I can get back to the fieldpoint, which is happily running its little app in a little
    one-room water plant in the mountains. Meanwhile, is there something more fundamental (and
    obvious to the veterans) which I am overlooking?
    This application employs DSC security features and I have deployed it bundled with the
    associated DSC files per the DSC manual instructions. All of that is apparently working fine;
    the stand-alone just won't FTP to the fieldpoint while the development copy will.
    Bob Miller
    P.S. This VI also employs TCP to continuously communicate control and status info with the
    fieldpoint, but the VI gives up on the link when FTP fails and never tries to open the TCP
    path.

    I will answer my own query for any casual readers. I dragged my
    notebook and my carcass up into the mountains last night to attempt
    to diagnose the problem. One word answer:
    Firewall.
    The Symantec firewall on the PC had been configured to allow Labview
    to access the network via TCP (which FTP is built on), but not an
    application named "Water Plant Watchdog". Reconfiguring the firewall
    (a two-minute job) fixed the problem.
    NI embeds a lot of "Disable Windows firewall" messages in the LabVIEW
    installer and/or documentation. This is an issue for a standalone PC
    connected to a fieldpoint and a dial-up ISP. So the firewall (and the
    LabVIEW application) must be managed to allow each other to do their
    job. Fortunately Symantec (Norton)'s firewall seems flexible enough.
    Bob

  • Development Environment

    I need to build a multi-tier java web application (JSP, Serlvets, EJB, JDBC, Oracle), but I've been away from Java for some time. I believe I should deploy onto the J2EE server, but I'm confused as to which development environment I should be using.
    Do I need J2EE SDK 1.3.1? Or Sun ONE Studio 5? Or both?
    Also should I seperately install Apache, Tomcat, and mod_jserv on my development machine?
    Thanks,
    Todd

    You will want the basic java environment for development. That would be the JSE1.4.2 (latest) ...but is it still not recommended to stick with 1.3.1_07 for mass public consumption ? Not to sure, but the point is ...you need the standard 'Java Install'. J2EE SDK 1.3.1 is an additional package you will need, yes ...for all the extra enterprise classes required by your particular endeavor.
    You won't need Apache or mod_jserv ...because you say you want EJB's. Tomcat and Apache standard stuff will run Servlets and JSP's ...but aren't a full blown application server ...and it is sounding like that's what you want. Be sure of what you want though ...EJB is a steep learning curve ...like straight up. As a solution they can even be the 'wrong thing to use' entirely and deciding if that's really what you need can require at least a certain degree of expertise to determine.
    However, if you really want an application server for EJB deployment ...that entirely depends on how much money you have to spend. Weblogic, Websphere are a couple of the $$$ names. But (ding) JBOSS is my favorite choice ...its free and actually the number two choice in the market right now ...go figure. It has a version that comes integrated with Apache Tomcat ...and is a powerful little beastie for sure. You want to steer clear of the J2ee server reference implementation Sun offers. Its just that ...a reference. It won't take you far and can't be used for production (i.e. can't serve remotely). So you might as well get right into the real thing since the subtle gotcha's are only going to set you back unless you get the real thing.
    You can get an IDE if you like ...but the command line works nicely too in all reality. Search IDE on these forums, along with APPLICATION SERVER and I am sure you will come up with a ton of links to various vendors.
    First off ...go get the JSE1.[whatever] and the J2EE 1.3.1 and get those up and running. After that you will be ready to set up your application server ...Rome wasn't built in a night. I admire your confidence. Need a consultant? Just kidding ...no I'm not ...yes I am.
    Good luck.

  • Development Environment for Server APIs in Webcenter Interaction 10.3

    Hi, I installed “Oracle Web Center Interaction 10.3" on standard environment mentioned by oracle (Window 2003 server, IIS6.0, SQL Server 2005). Everything works fine concerning the portal and services.
    I also have visual studio 2005 on the same machine and trying to setup a development environment where I can user server APIs (I start with creating IPTSession).
    I am using follwong code to start with:
    /String serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
    IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
    PortalObjectsFactory.Init(configContext);
    IPTSession ptSession = PortalObjectsFactory.CreateSession();
    Problem: code compiles if I add few dlls, but it do not run, it throws following error
    com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
    I think either server APIs are not more supported in 10.3 or I do not know how to setup the development environment for server APIs.
    Can anyone help??

    i have already tried putting hardcoded path but it didn't help, morover the previous line gives me correct path.
    I issue i mentioned seems to be related with some setting or missing native dlls
    com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
    i got follwing extract from the wsserver-wrapper.log file
    INFO | jvm 1 | 2009/02/20 12:26:17 | 2-20-2009     12:26:17.606     Info     OpenKernel.Config     Disabled-1235112977434     WrapperStartStopAppMain     com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider     Loading config data from C:\bea\alui\ptws\10.3.0\bin\..\..\..\common/../settings
    INFO | jvm 1 | 2009/02/20 12:26:18 | 2-20-2009     12:26:18.325     Info     OpenKernel.Config     Disabled-1235112977434     WrapperStartStopAppMain     com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider     Setting subscription data.
    INFO | jvm 1 | 2009/02/20 12:26:18 | container config context:EAS:wsserver
    i didn't modified anything in any config file, just configured everything on one machine with oracle configuration manager

Maybe you are looking for

  • HT1495 1 apple id for 2 ipods

    Hi, Can I use my existing Apple ID for both of my kids Ipods (touch)? Thanks, C

  • Flashplayer with 10.5.8 and Safari 5.0.6

    I need help!! How can i make work my older Macbook with the flashplayer?? Cant watch any videos on Facebook etc... I am using 10.5.8  and Safari 5.0.6

  • How to Upload WIP Production orders in production during Cutover.

    How to Upload the Open Production orders in production system during cutover activities. my client is having 1000 open production order(WIP), during cutover activies how to upload this in production. Please guide me Regards Sunil Patil.

  • HT4285 move music from my computer to iphone

    I have an iphone 4s.  I have a pc.  I had an adroid and easily copied the music from it to my computer.  now I want to put that music on my iphone.   I cannot figure this out.  I downloaded the itunes to my computer but the screen does not have the c

  • Changing art file names without reimporting?

    I have a book project just completed with about 150 pieces of art imported ... the publisher would like the art file names appended with the book title on them. I can do that easily enough in Bridge, but is there a way to accomplish this within InDes