Custom login form to change data source

Hi,
I actually went thru this link for some help on changing datasource at runtime.
http://www.jobinesh.com/2011/04/modifying-application-modules-jdbc.html.
Jdev version :11.1.2.2.0
What I am trying to is on my login screen i have three fields
User name Textbox
Pwd Textbox
DB ( SelectOne Choice)
Now when User is changing any db in SelectOneChoice(autosubmit =true) ,I am calling value change listener to set session variable.
public void dbChange(ValueChangeEvent valueChangeEvent) {
// Add event code here...
System.out.println("priint1");
//JSFUtils.setManagedBeanValue("sessionScope.dataSource", ADFUtils.getBoundAttributeValue("Name"));
JSFUtils.setManagedBeanValue("sessionScope.dataSource", valueChangeEvent.getNewValue());
System.out.println("priint2");
Also I am using DynamicEnvInfoProvider,code is as follows
package model;
import java.util.Hashtable;
import java.util.Map;
import oracle.adf.share.ADFContext;
import oracle.jbo.client.Configuration;
import oracle.jbo.common.ampool.EnvInfoProvider;
public class DynamicEnvInfoProvider implements EnvInfoProvider {
public DynamicEnvInfoProvider() {
super();
public Object getInfo(String infoType, Object env) {
if (EnvInfoProvider.INFO_TYPE_JDBC_PROPERTIES.equals(infoType)) {
Map session = ADFContext.getCurrent().getSessionScope();
//Object dsName = session.get(Configuration.JDBC_DS_NAME);
// System.out.println("Before "+session.get(Configuration.JDBC_DS_NAME));
Object dsName = session.get("dataSource");
System.out.println("Setting "+session.get("dataSource"));
System.out.println((String)dsName);
if (dsName != null) {
if (((Hashtable)env).containsKey(Configuration.JDBC_DS_NAME)) {
((Hashtable)env).put(Configuration.JDBC_DS_NAME,
(String)dsName);
//System.out.println("After "+session.get(Configuration.JDBC_DS_NAME));
return null;
public int getNumOfRetries() {
return 0;
@Deprecated
public void modifyInitialContext(Object initialContext) {
This is how appmodule config looks like
<?xml version = '1.0' encoding = 'UTF-8'?>
<BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">
<AppModuleConfigBag ApplicationName="AppModule.AppModuleAM">
<AppModuleConfig DeployPlatform="LOCAL" jbo.project="model.Model" name="AppModuleAMLocal" jbo.txn.disconnect_level="1" ApplicationName="AppModule.AppModuleAM">
<Database jbo.TypeMapEntries="OracleApps" jbo.locking.mode="optimistic"/>
<Security AppModuleJndiName="AppModule.AppModuleAM"/>
<Custom JDBCDataSource="jdbc/ADFTRAINDS" jbo.envinfoprovider="model.DynamicEnvInfoProvider"/>
</AppModuleConfig>
<AppModuleConfig name="AppModuleAMShared" jbo.project="model.Model" ApplicationName="AppModule.AppModuleAM" DeployPlatform="LOCAL">
<AM-Pooling jbo.ampool.maxpoolsize="1" jbo.ampool.isuseexclusive="false"/>
<Database jbo.TypeMapEntries="OracleApps"/>
<Security AppModuleJndiName="AppModule.AppModuleAM"/>
<Custom JDBCDataSource="java:comp/env/jdbc/ADFTrainingDS"/>
</AppModuleConfig>
</AppModuleConfigBag>
</BC4JConfig>
Now on click of button I am calling a action listener to execute a operation binding which is executing a procedure but even though using system out i see code going in DynamicEnvoProvider and setting value when combo box value is getting changed ,but procedure is not executing in the modified db its still running on jdbc/ADFTRAINDS.
Can anyone help me figure it out whats problem here?
Regards,

Hi,
Jobinesh blog post comes with a sample, did you try and run this? If so, does it work? Note that if the sample works it makes it easier to find he problem as it allows narrowing down the problem area to your implementation. If the problem reproduces with Jobinesh's sample then its a clue that the product may have issues with dynamic JDBC credentials
Frank

Similar Messages

  • I can not map field after changing data source location

    Hi
    I have a small problem that I got a report file and database from my customer, after that I setup database, open the file and change data source to my setting. but some filed can not map. The field mapping widonw does not display all field in the table. Of course I have checked the missing fields are existing in the table.
    OS:Windows7
    DB:Oracle11
    CR:XI Release 2
    Does anyone have an idea?

    hi,
    In Map Fields window, there is an option "Match Type".
    Please Unchek that option, so that you will be able to see all the fields from that table.
    Also, while mapping please verify the datatypes of source and target fields.
    Regards,
    Vamsee

  • Change data source

    Hi,
    In portal EP6.0
    In System Administrator->System Configuration->UM Configuration  here in Data Source Tab already data source is assigned to "Read-only microsoft ADS ( Deep Hierarchy ) + Data base". I changed this data source to "Read-only SAP System + Data base" and saved.
    But it is giving warninig message saying 'you are not allowed to select dataSourceConfiguration_R/3.xml as Active configuration file. This will lead to inconsistancy'.
    How can we change data source?
    Thanks in Adv.
    Ganesh

    Hi Ganesh,
    You want to change the configuration to this "Read-only SAP System + Data base" rite ?
    Dont change from here -System Administrator->System Configuration->UM Configuration in Data Source Tab
    Start the Config Tool by executing j2eeconfigtoolconfigtool.bat.
    Switch to Edit mode.
    In the tree, navigate to Global server configuration ® services ® com.sap.security.core.ume.service
    Here change the value of the property ume.persistence.data_source_configuration to the one you want to apply(for example dataSourceConfiguration_R/3.xml)
    Click on "Apply Custom" Save the changes.
    Restart the cluster.
    This should work.
    Let me know if you need any other help.
    Thanks,
    Samta

  • How to change data source name and context root during deployment

    Hi,
    Env:
    WLS 10.1.3
    JDev 11.1.1.6
    Hudson
    I need to deploy two instances of my ADF application on the same development enviroment. We are using Hudson to deploy. My question is how to change data source name and application context root before second deployment.
    Kuba

    I don't believe there is an inbuilt facility to do this.
    Previously how I've done this is when checking files out using Hudson jovs, before the build I then use an Ant extension called XmlTask (http://www.oopsconsultancy.com/software/xmltask/) to modify the required XML files.
    Can I ask why you're doing this in the first place please? Multi-tenancy? 2 versions of the same app?
    CM.

  • Changing Data Source for command objects

    Hi,
    My report (designed in CR 10) is running based on the Stored Procedure call using a command object; which is running successfully in the DEV environment. The report data source connectivity is a DSN.
    Now i want to switch it to QA environment with different DSN name. When i tried to update the Change Data Source option, it doesn't allows to update the existing command with a new command!!!!
    I don't know how to fix this. Could any one of you have idea, pls. share it here???
    Thanks
    Viswa

    If you have same table structure in new data source then you can change the datasource connection.
    Follow the steps in this article
    KBase Article ID:c2016958
    Article refers to:Crystal Reports 10
    Symptom
    In Crystal Reports (CR) 10, can you change the database connection of an existing command object to use a different database connection without the use of a Crystal Repository?
    Resolution
    Yes, you can change the database connection of an existing command object to use a different database connection without the use of a Crystal Repository by using the following steps:
    ====================
    NOTE:
    You must apply the CR 10 Monthly Hot Fix (cr10win_en.zip) and the CR 10 Database and Export Drivers Monthly Hot Fix (dbex10win_en.zip) before starting the steps below.
    You can download these hot fixes at http://support.businessobjects.com/search
    ====================
    1. Open a report with a command object.
    2. Go the 'Database' menu and click 'Set Datasource Location'.
    3. In the 'Set Datasource Location' dialog box, select the connection for the command object (the connection appears as a cylinder with a plug).
    4. In the lower window, select the new connection and log on to the database.
    5. Ensure the connection is highlighted for the command object in the top window, and the connection is highlighted for the new command object in the bottom window.
    6. Click Update.
    The database connection for the command object now changes to use the new database connection information.
    Regards,
    Raghavendra

  • Change data source dynamically

    is it possible to change data source dynamically when using ibatis frame work...?

    We don't need a Java reporting tool to change data source dynamically.
    In Oracle Reports we can use:
    - lexical parameters
    - dynamic ref cursors
    - XML runtime customization
    Regards

  • Change Data Source not showing tables (in the taget drop down) that begin with "SYSTEM"

    I am trying to change the data source to a database table that is named someschema.SYSTEM_XXX_XXX but none of my tables that are named SYSTEM_.......  are in the combo box list of the taget tables (Change Data Source) dialog.   I have tried this on several database with the same results.   Are you filtering out tables that begin with system ?

    <p>This issue has been resolved in the latest hot fix for CR4E.   You can download the latest version of the hot fix by   following these steps:</p> <ol><li>Go under the <strong>Help</strong> menu</li><li>Select the option <strong>Software Updates -> Manage Configuration</strong></li><li>Expand the tree until you see <strong>Crystal Reports for Eclipse 1.0.1.v671</strong> (or similar)</li><li>Highlight this entry and select the <strong>Scan for Updates</strong> option in the window on the right.</li></ol> <p>This will allow you to update to the latest version which is   currently <strong>1.0.2.v795</strong> </p> <p>Please let me know if this fix does not resolve the issue   outlined in this thread. </p><p> </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a>          </p>

  • Display Login failure when using External Custom Login Form

    I am new to OAM area and really apreciate if some one can guide me in the right direction. I have configured External Custom Login Form (thanks to fusionsecurity blog) with Oracle Access Manager 11g + webgate 10g. If I enter correct user id and password in the below form, then all is good and able to access the protected resoruce.
    If I enter incorrect values for loginname/password fields, then the from simply refreshes itself and does not give me any error message. How can display error message when a user enters in correct values for those fields?
    <form action="http://hostname:7777/oam/server/auth_cred_submit" method="post">
    <fieldset>
    <legend>Login Screen</legend>
    <label for="username" accesskey="u">User Name:</label>
    <input type="text" id="username" name="username" size="15" tabindex="1">
    <label for="password" accesskey="p">Password:</label>
    <input type="password" id="password" name="password" size="15" tabindex="2">
    <input type="hidden" name="login-form-type" value="pwd">
    <input class="submit" type="submit" value="Login" tabindex="3">
    </fieldset>
    </form>
    Thanks

    Hi!
    I have installed Oracle Access Manager 11g + Webgate 11g and not 10g, but I think
    it has to work beause login is being processed by OAM (/oam/server/auth_cred_submit);
    and it if does not work, it may give you a clue on how to do it.
    Having stated that fact, it is very simple to do it: whenever I try to access a protected
    resource and I am not authenticated I am redirected to my login page and some
    special parameters are passed to it such as: request_id, OAM_REQ, authn_try_count and
    some others.
    authn_try_count is the magic one as it show the number of login tries, so here is
    a code snippet of my login page which uses JSTL for conditional processing.
    <form...>
    <c:if test="*${param['authn_try_count'] > 0}*">
    &lt;span class="error-msg"&gt;
    <fmt:message key="login.val.wrong.login"/>
    &lt;/span&gt;
    </c:if>
    </form>
    Best regards,
    Jesús García from
    Mexico city

  • Trying to Change Data Source but is not highlighted

    I have a pivot table running with inventory and we are doing a  server upgrade so i need to change the path, but the "Change Data Source" button is not lit up and will not let me do this. Anyone know why this might be happening? Thanks!!!

    Hi Frank,
    We can directly update the existing connection string to connect to new server. Please take a look at the following articles:
    Different Ways to Update Data in PowerPivot:
    http://msdn.microsoft.com/en-us/library/gg399134(v=sql.110).aspx
    How to change the database for your PowerPivot sheet:
    http://www.keepitsimpleandfast.com/2011/04/how-to-change-database-for-your-power.html
    Elvis Long
    TechNet Community Support

  • OAM In Custom Login Form: Is there a way to get the user that was blocked?

    Hi
    I'm creating a custom login form and I need to capture which user was blocked if I get an OAM-5 error code. There is no parameter that specifies which user was filled and I can't capture it before because the login page post directly to the OAM Server.

    Hi
    I'm creating a custom login form and I need to capture which user was blocked if I get an OAM-5 error code. There is no parameter that specifies which user was filled and I can't capture it before because the login page post directly to the OAM Server.

  • 9iAS: Programmatically change data source for Java/J2ee bc4j application

    Background: We obtain a copy of our customer's live data daily for support issues. We'd like to be able to keep up to date as possible and get files early in the morning. due to the size of the database, it takes a few hours to download and import into our Oracle database. what I'd like to do is use two different schemas/users for the data, alternating on each day so that the loading of one, does not affect the running of the other. To make this seamless, I'd like to have a script perform the changes after the download and restart the server. The issue is how/where to change the data source so that my application will pick it up each time? I'm using an application specific data source from EM.
    Any ideas?
    Thanks,
    Jeff

    If it is intended to be accessible from Reports servlet then you can use "ssoconn" command line option where by the user name and password is stored in OID (Oracle Internet Directory)
    Pls see publishing reports to web document --> command line options -> rwservlet
    (link below)
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • Unable to change data source of any report

    Hello there,
    I am using the Crystal Reports Eclipse plugin. I added a datasource to Eclipse 3.3 which connects to a Oracle database using JDBC.
    Now I want to change the data source of a report. I get a popup window which displays the old data source with all tables and columns on the left side. On the right side of the window I see the name of the new data source at the top, but a list of "remove" options below it with a red cross in front (see screenshot).
    It does not matter if I want to change an existing report or a new report.
    I can create a new report with a datasource, but even when I want to change to the same datasource as already assigned to the report, I get the problem described above.
    I already followed some tips found in this forum, e.g. expanding all used tables in the data source explorer etc., but this did not help.
    I know that there was also a possibility to remove the "data source" information completely from the query (as mentioned at http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do;jsessionid=2F140BDBA03E8E97EEF1E15F84964F12?cmd=displayKC&docType=kc&externalId=c2017570&sliceId=&dialogID=13402443&stateId=1%200%2013406567), but I cannot find this option in Crystal reports for Eclipse. I see a field "qualified name" in the properties of each table of my report, but this field is read-only...

    Doesn't anyone have an answer to this problem? I would just like to change the datasource of a report. But I am not able to do so, because the only option I have in the dialog is to remove all tables.
    I just saw that the screenshot is missing. See it here:
    http://img119.imageshack.us/img119/4999/pic1dh1.png

  • Crystal Report runtime error while changing Data Source Location

    Dear All
    We are using "Crystal reports for SAP Business one".The Crystal reports version is 12.1.
    We built a report in another database with another server.
    As we are importing the report in another database of another server,
    I am not able to change the Data Source location.
    When I am trying to change it,it gives Runtime error and closed automatically.
    How can i resolve and change the data source location?

    hi kambadasan,
    is your CR version the same from which you design the report and to the another server? also did you import your report directly to SBO without changing the data source first? in the case you should update first your Data Source in Crystal Report IDE before importing it to SBO.
    regards,
    Fidel

  • Cannot Change Data Source - Error The memory could not be "read"

    We have some reports that were created under Crystal Reports version 10 using a Sybase 12.5 database as the datasource.  We have since upgraded to Sybase 15 ASE and we are also attempting to upgrade these reports to Crystal Reports version 11.5.  The reports will convert to version 11.5 but will not work because of the following error:
    "Failed to load database information. Details: The database connector 'crdb_p2ssyb10.dll' could not be loaded"
    From previous experience we know that Sybase 15 is only supported via ODBC with Crystal Report 11.5, so we tried to change the datasource to ODBC, but when we do that we get the following error:
    The instruction at "0x0e864b11" referenced memory at "0x00000004". The memory could not be "read".
    Do we have any options at this point besides competely re-creating the reports?

    We are using CR 11.5 and trying to change the data source to ODBC.  I can create a new report and use the same stored procedures as a datasource via ODBC with no issues.  I only have an issue when trying to change the data source on these existing reports.

  • Change Data Source for a lot of Crystal Report

    I have a lot of reports which use Visual FoxPro as datasource. We will mirgrate to MS SQL Server and change the names of tables. Is there any way to set data source to new table in new ODBC other than do it manually ? Please advice.
    Thanks.

    Hi Leo,
    If you use Business Objects Enterprise, then you can use a tool called 'Schedule Manager' to update the datasource of all your reports to SQL Server - at one go!
    If you don't then, well, it gets laborious and you'll have to get into every single report and use 'Set datasource location' within CR.
    -Abhilash

Maybe you are looking for