BC4J datasource connection configuration

When I change the connection for a BC4J AppModule using the 'Configurations' option on the popup menu for the application module, JDeveloper ADDS! the new connection to the bc4j.xcfg file. The old connection remains in the config file and the application module continues to use the original connection. Can someone tell me if I can change the connection without manually hacking the bc4j.xcfg.
Thanks.

If you are on a Windows machine, setup a data connection in
the ODBC control panel on the machine itself first, then connect to
it using the ODBC Socket option in the DB section of CF ADmin
Considering the advancement of XML data and other available
data options, txt files are not used that much any longer. It would
likely be just as fast to simply open the TXT file with CFFILE and
parse it that way.

Similar Messages

  • How can I reuse the BC4J database connection?

    How can I reuse the BC4J database connection?
    I want to use the application module connection without opening another in a custom code. At this level I can’t access de ADF code, that’s why I can’t get the DBConnection from the application module.
    Now, I have a “data-sources.xml” in my project and the application module is configured to access the database from this xml file.

    I found the solution in other Forum. I worked ok.
    Here the code:
    If the Connections-Navigator connection is DBConnection1, the corresponding datasource is jdbc/DBConnection1DS.
    1. Create a JSP page.
    2. In the web.xml of the JSP add
    <resource-ref>
    <res-ref-name>jdbc/DBConnection1DS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    3. In the JSP page obtain a connection with the datasource.
    InitialContext initialContext = new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource)initialContext.lookup("java:comp/env/jdbc/DBConnection1DS");
    java.sql.Connection conn = ds.getConnection();

  • Loosing datasource connection in a server thread

    Hi,
    In a backing bean I start a long term thread that uses the datasource connection taken from application module.
    Everything works fine but after a period of time between one and two hours the connection is lost and server throws a
    <BEA-001112> <Test "SELECT 1 FROM DUAL" set up for pool "AEE2010DS" failed with exception: "java.sql.SQLException: Connection Closed".>
    Is there any way to stop the server from closing the connection that is used in a separate thread, programmatically or using configuration?
    Any comment will be helpful,
    Thanks

    That looks like something external is killing the connection, either the DBMS or a firewall.

  • DataSource Connection Pooling in 903?

    We are having difficulty getting 9iAS DataSource Pooling to work. We are using 9iAS 9.0.3 (without Infrastructure) and, as per the J2EE Services Guide, have :
    1) Added...
    Context ic = new InitialContext();
    DataSource ds (DataSource) ic.lookup("jdbc/OracleDS")
    Connection con = ds.getConnection();
    ...to our code.
    2) Modified the default DataSource's url, username, password, min-connections & max-connections from within Enterprise Manager (leaving ejb-location as is at "jdbc/OracleDS") and restarted the Instance.
    The app generates an exception when trying to locate the OracleDS, however.
    We have also tried replacing the "com.evermind.sql.DriverManagerDataSource" class with "oracle.jdbc.pool.OracleConnectionCacheImpl" as per another post's recommendation.
    It appears that others have had similar problems (prior to 903?), but many have, in fact, (now) got this working successfully -- what are we missing please......?
    Thanks.

    Hi people!
    I have a question on the above code.
    I tried it myself on OC4j 9.0.3 (the one that comes with JDeveloper) and I noticed the connections on the pool. The problem is the behaviour of this code when the datasource is configured to have as a "max_connections" attribute a value less than 10, e.g. 8.
    I tried a datasource of the following form
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="OracleDS"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="myuser"
              password="mypass"
              min-connections="2"
              max-connections="8"
              url="jdbc:oracle:thin:@localhost:1521:orcl"
              inactivity-timeout="60">
         <property name="cacheScheme" value="DYNAMIC_SCHEME"/>
         </data-source>
    but the execution of the code stops when it comes to get a Statement object out of the 9th connection object. Isn't the pool supposed to give a new connection and remove it when it's finished with it? After all, the documentation says that this is the default behaviour of the pool (it is not necessary to declare the DYNAMIC_SCHEME in the data-source.xml)
    I am interested in this, because I have a bunch of JSP files (100 of them or even more) that shall use the same connection pool. If some of them are being executed concurrently, then there will definitely be a problem with the available connection objects.
    Thanx

  • Datasource connection failing with error "Cannot open resource"

    Hi All,
    I have created a datsource in VA with JDBC 1.X driver type for a SQL Server.
    However, now when I try to connect to the datasource from an udf in the Message Mapping, I am getting the below error:
    Error: com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.connector.exceptions.BaseResourceException: Cannot open resource(Managed Connection) with LocalTransaction support or add a second one in the same transaction, for component "webContainer/applications/sap.com/TestDB/TestDB" in application "sap.com/TestDB"
    I checked the SAP Help link given below where it is mentioned as a solution that the datasource should be made shareable.
    http://help.sap.com/saphelp_nw04/helpdata/en/5c/2f2c4142aef623e10000000a155106/frameset.htm
    In SAP Help, it mentions that datasource can be made shareable by modifying the deployment descriptor as mentioned in the link below. However, the datasource was configured in the VA and not deployed using archive. Hence, we do not have a deployment descriptor to modify and redeploy.
    http://help.sap.com/saphelp_nwce10/helpdata/en/e8/47591ac2e843d09a374e88b044bda9/frameset.htm
    Could you please provide pointers on how configure and make the datasource shareable.
    Thanks & Regards,
    Rosie Sasidharan.

    Hi Rosie ,
    This information is really really helpful for me  . I was trying to solve this problem from last 4 days. Today i am able to solve just because of reference given by you.
    Once again thank you very much

  • Oh my god! I'm still getting bothered in establishing my BC4J DB connection ...

    I've post many many posts regarding the establishment for my BC4J DB connection by code ... Once again, I am developing Java-base web applications:
    Situation: I'm still using the following code to return an application module, whatever DB query/update is needed, I'll obtain an application module for processing with it. John has replied me such method is not good enough as it assumed to be held in a long period. Then I consider improvement.
    public ApplicationModule getAppMod () {
    Create an instance of the application module by name, using local mode
    ApplicationModule am = Configuration.createRootApplicationModule(_am,_cf);
    return am;
    Question 1: I have tried looked at the PoolServlet examples locates at \BC4J\Samples directory. It does no big help as it is quite complicated. In fact, I don't need any SessionCookies. I just need to consider the following points:
    1) Simple codes
    2) Pooling considered
    3) Codes centralization (i.e. All request go through a piece of code to obtain the Application Module instance. Have pooling be considered already?
    Situation 2: My friend recommends me to make use of the Pooling Manager, then i try the following codes:
    public ApplicationModule getAppMod () {
    ApplicationModule am = null;
    try {
    Hashtable env = new Hashtable(10);
    env.put(JboContext.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    PoolMgr.getInstance().createPool("TestPool", _am, "jdbc:oracle:thin:usrname/pwd@ip:port:sid", env);
    ========================================
    ApplicationPool pool = PoolMgr.getInstance().findPool("TestPool", "CdbsJboPkg", _cf, env);
    am = pool.checkout();
    } catch (Exception e) {
    e.printStackTrace();
    return am;
    It seems simpler anyway.
    Question 2: Is it feasible? I have received error message for the underlined connect string. Please advice if it's appropriate and correct?
    Thanks for replying!

    Pig Mug,
    Our Configuration object is designed to provide what you need. It's design to provide a simple solution when your needs are simple, hiding some of the complexity (that comes with the power) of the lower-level Application Module pooling framework.
    It does use the application module pool underneath, provided that when you call releaseRootApplicationModule() that you pass false for the second argument, indicating that you do not want this AM instance removed.
    The Configuration API is designed for simple needs and is typically appropriate for BC4J client applications that are either "batch jobs", or else, totally stateless.
    The underlying application module pool provides more sophisticated features that relate to the maintenance of user sessions and the management of application module instance whose logical work for a given user session can span multiple requests without dedicating a phyiscal application module instance to each session. This is also known as "Web Tier State Management".
    For example, when you:
    [list]
    [*]Expose one or more "Client Methods" on your application module, then
    [*]Right-mouse "Generate Web Service Class..." on the AM in the navigator
    [list]
    You'll see that the web service class produced makes stateless use of an application module using the Configuration API. If there were any state involved, then this would be the wrong approach and the lower-level AM Pool API's based on SessionCookie's would need to be used instead.
    Hope this helps.

  • DataSource & Connection pools

    Hi,
    I have a couple of question about DataSources and connection pools.
    1. Are DataSources & connection pools the same thing?
    2. Typically the data-sources.xml file, shows in plain text a user/name password combination. Isn't this a security risk? Can anything be done about this?
    thanks in advance,
    Kevin

    Hi Kevin --
    1. Are DataSources & connection pools the same thing?
    A DataSource enables the clean abstraction of the database connection details from the code.
    A DataSource has a name, and it provides you with access to connections via some configuration information it has (ie database host, port, sid, username/password). To get a connection, you first locate the datasource, and then ask it for a connection.
    Since the DataSource is now providing access to connections, you can get different types of DataSources that give you different behaviour. One example of this is a DataSource which supports connection pooling -- it will pool the connections for you. Some other datasources will support the use of container-managed-connections, which are used by EJB containers to support CMT.
    So while a DataSource can support connection pooling, the two are not synonomous.
    2. Typically the data-sources.xml file, shows in plain text a user/name password combination. Isn't this a security risk? Can anything be done about this?
    In the current production version and prior, the data-sources.xml file stored details in clear-text. Besides ensuring that the file has the correct level of OS priviliges set on it to ensure it can't be easily viewed, the only other workaround was to specify the username/password as parameters to the ds.getConnection() method. This puts the username/password back into the code so it breaks the concept of clean abstraction, but it was an option to avoid it being in the xml file.
    In our 904 release (available as a dev preview now on OTN) we support the use of password indirection for the passwords in this file. This enables you to specify a logcal name for a password, then create the actual user/password combination in our encrypted JAZN user repository. When the datasource is used, the container follows the indirection and retrives the password from the encrypted storage area.
    I'm pretty sure this is documented in the beta version of 904 J2EE Services Guide, see
    http://otn.oracle.com/tech/java/oc4j/904/doc_library/services-904-preview.pdf
    cheers
    -steve-

  • Connection Configuration to Central Services Registry in PI7.1

    Hi Freinds,
    while in CE7.1-
      NWA->Configuration Wizard-> I have this set up file Connection Configuration to Central Services Registry to configure the central service registry.
    while on PI7.1 EHP-1
    I dont have this setup file Connection Configuration to Central Services Registry.
    Is this included in Any Configuration service, or with different name?
    Regards
    chandra Dasari

    Hello Chandra
    See the link below.
    Configuring a Central Services Registry 
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/46/bb923d06582710e10000000a11466f/content.htm
    Regards
    Mark

  • Error !! Cannot fetch a datasource connection

    I am a beginner in Oracle BPEL process Manager,
    i am experiencing the following error :
    After starting the BPEL PM server, i got the following in the Dos Window:
    " Message Handle error:
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.process.SetDbDefaultMessage."the exception is tranaction was rolledback........"
    then i tried also to open the BPEL console and i logged in , but i got
    "Cannot fetch a datasource connectionThe process domain was unable to establish a connection with the datasource with the connection URL "jdbc/BPELServerDataSource". The exception reported is: Internal Error:Invalid Connect String
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid."
    What could be wrong !
    Please Help.
    Thanks in advance

    Hey Rana,
    in OC4J_BPEL container, that is located under $AS_HOME/j2ee go to the config directory and open data-sources.xml.
    it seems during installation you might have provided wrong information..
    could you pls paste it here, that we can figure out what's wrong..
    in what enviroment did this occur,
    thx clemens

  • Datasources connection questions

    hi all
    my question is about How the connections stored in a Jndi server datasource pool are managed.
    For example, I'm developing a J2EE application with Ejbs and Datasources, etc. I saw that when I want to retrieve a connection from datasource to work on it I need do something like this:
    For example to retrieve a datasource connection:
    Hashtable jndiProps = new Hashtable();
    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,...);
    jndiProps.put(Context.PROVIDER_URL, ...);
    Context context = new InitialContext(jndiProps);
    DataSource ds = (DataSource) context.lookup("jdbc/MyDatasource");
    Connection con = ds.getConnection();
    ...I know in this case that the server manages a datasource connection pool, etc
    My question is when a get a connection from the Datasource pool of my app server. do I need to release the connection with some special method when I finish with it (in order to return it to the pool) or it doesn't matter ?
    thanks in advance

    If I have three prepared statements right in a row with nothing in between should I close the connection after each one and then get it again?
    Seems like I would be just as well off to just get the conn once do the 3 things then close it.
    and in spots I might actually be doing something as i step through the first result set so can i use conn.preparedStatement() in the loop many times without getting the connection and closing each time through the loop?
    i of course close all PS and RS and use diff PS2 and RS2 in the loop so i 'm just talking about keeping the conn open while (RS.next()) and use it multiple times to conn.preparedStatement() inside the loop?
    or should i use 2 connections lol and open conn1 and then in loop use conn2 and close it each time around the loop and then close conn1 when i exit the loop?

  • Ucm connection configuration on webcenter portal app

    Hi All,
    We create a webcenter portal application and connect with Webcenter content using Application Resources --> connections --> content repository connection.
    The parameters that we provided for the connection are:
    Socket type: socket, Hostname, Port, Admin username and Password. We havent given the Webserver context root and Url of the webserver plugin.
    In enterprise manager console while we check the webcenter connection configuration, the Web server context root /cs is automatically availble eventhough we havent provide them while creating our connection(checked on connections.xml also), because of which while using content presenter contributor mode, the UCM environment is opened inline.
    We want our UCM enviroment to get opened in a new window as normal one and not on inline and may i know why the webserver context root is automatically available eventhough we didnt provide it explicitly
    thanks

    Faces messages are displayed in a pop-up by ADF. This is the default behaviour.
    If you want to display Faces Messages inline, then include the af:messages tag in an appropriate place with the inline attribute set to true. Add this to your home page.
    <af:messages inline="true" id="m1"/>

  • Missing "Connection Configuration to Central Services Registry" in Config Wizard in NWA

    Hi,
    When we trying to do the following operation [ by referring the document http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&uact=8&ved=0CD8QFjAE&url=http%3A%2F%2Fdocencia.…]
    Configuration Management > Scenarios >
    Configuration Wizard > Start the Connection Configuration to Central Services Registry task in NWA for setting up the Service Registry, we don't see this task in the list.
    Can someone help me in starting this task ???
    Regards,
    Samba

    Hello Chandra
    See the link below.
    Configuring a Central Services Registry 
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/46/bb923d06582710e10000000a11466f/content.htm
    Regards
    Mark

  • BUG: Can't create BC4J Application Module Configurations

    Hello,
    I'm using JDev 9.0.3.1 with Win2K and WinXP. There seems to be a bug in the BC4J Application Module Configuration Manager:
    It seems to be impossible to create a new BC4J Application Module Configuration with the Configuration Manager of a BC4J Application Module. I can copy an existing AM configuration, but I can not rename it. Clicking on the OK Button in the Configuration Manager simply does nothing.
    A work around seems to be to open bc4j.xcfg in any text editor, copy an AppModuleConfig element, save xcfg, in JDev remove the project form the workspace, readd it to the workspace (some caching issue of jdev?). Then the new AM config is there and can be modified.
    In JDev 9.0.3 the Config Manager seems to work fine.
    Regards
    Stefan

    The bug is mentioned in metalink bug 2849146.

  • EnvironmentException: -600: Could not retrieve a datasource connection

    Hi,
    I am getting below errors in my logs has anybody have any idea about below errors.
    0.4 IJFWK-302 itseelm-lx4065.xxx.com 2013-02-12 05:55:40 EBCCOP01 971 NA BsGetDeliveryMethods irwuser irwuser EBCCOM01 28442421A3EF52E9C8692AA9F19FFC42 37 <?xml version="1.0" encoding="UTF-8"?> <SystemError><Message>-302: Error caught while executing the business task. Marked transaction for rollback; nested exception is: com.xxx.xxxx1.util.exception.EnvironmentException: -600: Could not retrieve a datasource connection for user 'null'.; nested exception is: com.ibm.websphere.ce.cm.StaleConnectionException: The Network Adapter could not establish the connectionDSRA0010E: SQL State = 61000, Error Code = 20</Messa
    Thanks
    Edited by: Ramstimo on 15 Feb, 2013 9:34 AM
    Edited by: Ramstimo on 15 Feb, 2013 9:36 AM

    Hi,
    Can you paste the jdbc connection that you have used in your application code here?
    Regards,
    Kishore

  • Script for checking datasource connections

    Hi,
    I would like to find out if it's possible to monitor datasource connections using Unix based scripts and if so how can this be accomplished?
    Thank you in advance
    Twaggz

    Hi
    Thanks for the link however I was looking at enabling monitoring at an AIX level.

Maybe you are looking for

  • I cant access firefox, everytime i try i get that windows can't find the file, i tried redownloading it but it still gave me the same message?

    i cant access firefox, everytime i try i get that windows can't find the file, i tried downloading it again but it still gave me the same message. the problem has nothign to do with my internet because it wonks on internet explorer and everythign is

  • How to save more than one Contact Person in CRM

    Hi experts,                  How to save more than one contact persons in CRM opportunity Application? I am using following Function Module...   CALL FUNCTION 'CRM_ORDER_MAINTAIN'     EXPORTING       it_partner        = lt_partner_com     CHANGING   

  • Help! Can't use Text tool in Photoshop CS5

    When I launched Photoshop this morning and opened a file containing text and an image, I got the following error message: "The type layers in this document were rasterized because something prevented the text engine from being initialized." When I cr

  • Failed to execute $emca -reconfig dbcontrol -cluster

    Hi gurus, Environment: RAC Database 10.2.0.4 with 2 instances running on a Cluster with 2 nodes (AIX 5.3) I have a problem with Reconfigure DB Control: [oracle@dwbd01>$emca -reconfig dbcontrol -cluster STARTED EMCA at Nov 8, 2012 10:52:02 AM EM Confi

  • Code style vs efficiency

    I think that programing in Java, like a hight level language it better keep a clear an explicit code like int b=0; if (a){ b=1; } else { b=0; but, in the other hand, we can write all of this in a single line like int b= (a) ? 1 : 0; but, once both co