[Deployment] How NOT to hard code the Database SID, Username, and Password

Hi, I'm new in J2EE so be easy on me. :)
How can I parameterize the database SID, username, and password in my J2EE application? So that anyone can change the SID, username, and password without the need to modify my code? I use Oracle 10g, ADF BC, JSF and JDeveloper 10.1.3.1.
My friend said that I can use XML for this. But he didn't go to detail for doing this. Is it true? Is there any [or better alternative]?
Any help or pointer to a simple tutorial would be fine.
Thanks in advance.

Hi -- this is quite easy to do with J2EE.
In your application code, you declare "logical" references to resources (such as datasources, security roles, etc.) and use those in your application code so all it depends on is the logical name
On the server where the application is deployed, "physical" resources are created that point to the actual resource -- in the case of a database, this would be the JDBC URL, username, password.
At deployment time of the application, you then use the facilities of deployment tool to "map" the logical references in the application, to the physical references that exist on the server. So you connect the dots between your application needing something and the server providing the something. That way all the "details" are abstracted out of the your application code.
I don't know how this works in ADF, BC4J, etc. but I presume that since they are based on standard/J2EE, it must be available somehow.
I wrote something about this a while back using direct JDBC as an example:
http://buttso.blogspot.com/2006/06/datasource-lookup-using-javacompenv.html
-steve-

Similar Messages

  • Claims Based Authentication SPSecurityTokenService.Issue() failed: The security token username and password could not be validated.

    Please excuse the lousy table...Its late :-)
    I have a multi-server SP2010 farm.  Patched up to
    Configuration database version: 14.0.6106.5002
    My goal is to have a claims based web application that authenticated to ADAM for Extranet.  I have configured the servers exactly to MSDN and technet specs (following this spec to the
    letter (
    http://technet.microsoft.com/en-us/library/ee806882.aspx) to allow the forms side of the web app to authenticate to ADAM.
    IT WORKS IN DEV!!! , which is a single server farm.  However, it does not work in production.  I get the following:
    Claims Auth log entries:
    1:06:25 AM
    w3wp.exe (0x0EDC)                      
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    f2ut
    Verbose
    Authenticated with login provider. Validating request security token.
    1:06:25 AM
    w3wp.exe (0x0EDC)                      
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    0
    Verbose
    Using membership provider 'ADAMProvider'.
    1:06:25 AM
    w3wp.exe (0x0EDC)                      
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    0
    Verbose
    Doing password check on '[email protected]'.
    1:06:46 AM
    w3wp.exe (0x0EDC)                      
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    0
    Verbose
    Failed password check on '[email protected]'.
    1:06:46 AM
    w3wp.exe (0x0EDC)               
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    0
    Unexpected
    Password check on '[email protected]' generated exception: 'System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: The security
    token username and password could not be validated. (Fault Detail is equal to Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The security token username and password could not be validated.).'.
    1:06:46 AM
    w3wp.exe (0x0EDC)                      
    0x1790
    SharePoint Foundation        
    Claims Authentication        
    fo1t
    Monitorable
    SPSecurityTokenService.Issue() failed: System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: The security token username and password
    could not be validated. (Fault Detail is equal to Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The security token username and password could not be validated.).
    1:06:46 AM
    w3wp.exe (0x1B34)                      
    0x08A0
    SharePoint Foundation        
    Claims Authentication        
    fsq7
    High   
    Request for security token failed with exception: System.ServiceModel.FaultException: The security token username and password could not be validated.    
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response)    
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)  
      at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst)    
    at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)
    1:06:46 AM
    w3wp.exe (0x1B34)                      
    0x08A0
    SharePoint Foundation        
    Claims Authentication        
    8306
    Critical
    An exception occurred when trying to issue security token: The security token username and password could not be validated..
    1:06:46 AM
    w3wp.exe (0x1B34)                      
    0x08A0
    SharePoint Foundation        
    Claims Authentication        
    f2un
    Verbose
    Form authentication failed.
    I have tried EVERYTHING (well, nt everything, I don’t have the fix I suppose). 
     I found plenty out there and nothing directly correlates with this issue. 
    I searched on all parts of the errors I got.
    This contains an interesting blurb about setting up access for the apppool id correctly. 
    That’s not the case for me.  It works in dev and the same id are used there. 
    http://sharepoint-2010-world.blogspot.com/2011/03/adam-forms-based-authentication-in.html
    This was good but it doesn’t give specs on what the environment looks like:
    http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/557143a6-4b36-4939-bb7f-d62a9335fd18
    The was interesting…but I am patched up beyond the June 2011 CU so it’s a moot point:
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/9b8368ef-c5e5-4ead-b348-7b2b5587cfc8
    Any and all help would be greatly appreciated!

    Hi.
    You say its a multiserver farm, do you have more than one web server then?
    If thats the case, have you tried accessing the site on each server directly?
    Found this for you, maybe that can help?
    Troubleshooting Exceptions: System.ServiceModel.FaultException`1
    http://msdn.microsoft.com/en-us/library/bb907220.aspx
    and this:
    SharePoint 2010 Claims Authentication - The security token username and password could not be validated reoccurring every morning
    http://social.technet.microsoft.com/Forums/pl-PL/sharepoint2010setup/thread/383f1f9b-5c4a-4e19-b770-2a54b7ab1ca1
    and
    This seems to be a good guide:
    http://donalconlon.wordpress.com/2010/02/23/configuring-forms-base-authentication-for-sharepoint-2010-using-iis7/
    Good luck
    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blksthl.wordpress.com

  • I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I could do that, however when I select the icloud button (or whatever the heck it is) I am asked to enter the apple id and password. So if you are suppose to create another one for icloud you'd think it would give you the option at this point which would be logical.

  • Adobe Revel?  I have forgotten:  the URL; my username and password.  How do I ask Adobe for these items?  Thanking your reply !!!

    Adobe Revel? I have forgotten: the URL; my username and password. How do I ask Adobe for these items? Thanking your reply !!!
    [email protected]

    Dave,
    No worries, this link will help you with your issues. You do have a revel account with that email, so resetting your password should be all you need to do. Just click on the "I forgot my password" link on the web page listed below:
    http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    Once you reset your password, you should be able to login to revel at adoberevel.com on a browser or from one of our apps on mac, ios, win8, or android.
    Pattie

  • How do I stop Firefox from filling in usernames and passwords when other people use my computer?

    When other people use my computer, how do I stop Firefox from filling in usernames and passwords?

    *Click the (empty) input field on the web page to open the drop down list
    *Highlight an entry in the drop down list
    *Press the Delete key (on Mac: Shift+Delete) to remove it.
    Remove saved Password(s):
    * Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    Password Manager:
    *http://kb.mozillazine.org/Password_Manager

  • Can I use the same icloud username and password for multiple phones?

    I have 6 iphones and wanted to use Apple Configurator to install the same apps on all 6 phones.  Some of the apps though, also require further installation by email.  Can I use the same iCloud username and password for all 6 phones to download the apps and also to configure email or do I need to create 6 different Apple IDs?

    If different people will be using these phones, you might be better off using the same Apple ID for the iTunes content...apps, music, etc. on each of these devices, but create different ID's for iCloud on each device. You can use one ID for the iTunes/App store, & a different ID for iCloud. That way, messages, notes, contacts, calendars, etc will be kept separate on each device.

  • What is the print server username and password?

    I am trying to install a Kodak ESP 5210 printer.
    I set up the printer - it is on my wireless network.
    I installed the Kodak printer software - it too installed correctly.
    At the final step I need to "add printer" I click + in the printer window.
    I then choose the kodakaio directory under "Windows".
    I then choose kodakesp5200_00.
    I am asked for the print server username and password.
    I tried my log in password with just my first name in lowercase as username as this field was filled out by default.
    I tried lots of different things, including no password, but the printer "Add" button never becomes not greyed out.
    Would appreciate help. Kodak were no help.
    I have pinged the printer successfully so its definitely on the network.
    Thanks

    Because nothing is listed in the default printer directory

  • My mail has stopped receiving anything and is saying the IMAP server username and password is wrong but I haven't logged out or changed anything?

    My mail (hotmail) has stopped receiving emails and keeps saying the IMAX server username and password is wrong when I haven't changed anything?

    Hello ,Marshyy96
    That is not good, lets see if we can get your email back up and running again. Take a look at the article below to go over the settings to just make sure nothing is out of the ordinary. You may end up needing to remove the email account and add it back in. 
    Get help with Mail on iPhone, iPad, and iPod touch
    http://support.apple.com/en-us/TS3899
    Regards,
    -Norm G. 

  • I am unable to connect to my RackSpace Windows Server via ARD. I have added a computer entering the ip address, username, and password but I can't establish a connection. I am missing a setting or to step that is different in ARD?

    I am unable to connect to my RackSpace Windows Server via ARD. I have added a computer entering the ip address, username, and password but I can't establish a connection. I am missing a setting or to step that is different in ARD?

    ARD only works with Windows computers if the Windows computer is running VNC server software.  Even then it can only control and observe.  Do you have this installed?

  • Write code for authentication of username and password using struts

    write code for authentication of username and password using session using struts with jdbc connection..

    write code for authentication of username and
    password using session using struts with jdbc
    connection..and please, allow me to spoon feed you!

  • Can avoid the entering my username and password always when i click on URL

    Hi,
    Iam new to BSP,i developed a simple BSP application to display a list of orders on the second page when a cutomer is entered in the first page. it is working fine.
    when i test the BSP application, it is asking for username and password.when i entered my username and password it is working fine.
    Then my question is when i test the BSP application, can i avoid the entering the username and password always.
    is there any way we can avoid the entering my username and password always when i click on the URL.
    Thanks
    Srinivas Manda

    sure.
    You can include the password and the username in the BSP link :
    <bsp_lnk>?sap-client=<client>?sap-user=<username>?sap-password=<password>
    where:
    <client>  = client where the username and password are defined
    <bsp_lnk> = your bsp link
    <username> = your username
    <password> = your password
    Regards,
    fabrizio

  • My moms computer died we are putting the old drive into the new computer as a slave drive. how do I transfer all the bookmarks, user names and passwords from the old drive to the new drive?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/889318]]</blockquote>
    Hello,
    Sorry if this posted twice I am NEW. I thought I could just go back to what I typed and add to it. Mom had a computer it died they are putting in the old drive on the new computer as a slave. What are the steps I need to do to transfer ALL the bookmarks, user names and passwords onto the new computer. We will have 3 desktops do we have to do the same steps on each desktop? I do not want to re enter all the user names and passwords on the new hard drive. Old computer was Windows XP the new computer is Windows 7 Kathryn Schwartz

    Duplicate - https://support.mozilla.com/en-US/questions/889318

  • How do I get Firefox to remember two usernames and passwords for att.yahoo?

    Firefox remembers one username and password, does not auto-fill-in the information (which is good), but will not ask to remember the second username and password. How do I get Firefox to remember the second username and password?
    I have two e-mail accounts which use the same login page, one account is sbcglobal and the other is yahoo. I would like Firefox to remember both sets of information so I don't have to type all the username and password information for one account.

    * Make sure that you not run Firefox in (permanent) [[Private Browsing]] mode
    * You are in Private Browsing mode if you see "Tools > Stop Private Browsing", possibly grayed
    * You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    * To see all History settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Automatically start Firefox in a private browsing session"
    See also http://kb.mozillazine.org/User_name_and_password_not_remembered

  • How easy to sniff a public FTP/HTTP username and password?

    Hi IT Colleagues,
    I understand that using plain FTP/HTTP , it is possible to sniff username and password using sniffer like wireshark.
    However, I just to want know how easy to do it.
    I know that in order to sniff , you should be in the same network or subnet as the website or ftp site.
    Regards,
    Jhun

    It is trivially easy to sniff credentials out of FTP and HTTP due to the fact there is no encryption at play. One should also not simply consider the risks of someone running a sniffer on your local area network, or on the local area network of the remote
    server, website or ftp site, but should consider the possibility for traffic to be sniffed along the way. The NSA is doing a rather good job of sniffing all of our traffic, credentials and all! Don't just worry about someone like the NSA though, a malicious
    user on an ISP network, or an administrator of a proxy server could just as easily sniff the plain text traffic.
    Kieran Jacobsen @kjacobsen http://aperturescience.su

  • Is the sign-in username and password for firefox the same for mozilla

    I am in the Firefox getting started tab. I tried to sign-in using the account log-in information for Mozilla. Are these two separate accounts?

    Every website on the mozilla.org domain has a separate user database for registration and login.
    ''I have accumulated 12 username / password entries for mozilla.org websites over the past 10 years. And most of them use the same username and password!''

Maybe you are looking for