Deployment using JDBC DataSource instead of JDBC URL

Hello,
I've noticed some strange behaviour when deploying an ADF application (11g, latest release) to a WLS (integrated or stand-alone), when using JDBC DataSource as a connection type for the application module.
Normally, when you create your Business Components, a Database Connection is added to the Application Resources panel, eg MyConnection. If you then set your AM to JDBC DataSource instead of JDBC URL, the default datasource would be jdbc/MyConnectionDS. To make the application use the DataSource defined on the WLS, I then uncheck "Auto Generate and Synchronize weblogic-jdbc.xml Descriptors during deployment" in the Application Properties > Deployment tab.
So far so good: after deployment to the WLS, the application uses the DataSource defined on the WLS server (jdbc/MyConnectionDS). When changing it on the server to another database, the application indeed uses this other database. Also, the following is automatically added to the web.xml during deployment to .ear file:
  <resource-ref>
    <res-ref-name>jdbc/MyConnectionDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>Now the part that doens't make sense to me: if I delete the password in the Database Connection under Application Resources, I can still deploy the application, but the jdbc/MyConnectionDS on the WLS is not found anymore. While it is still there. I get the following error message:
Unable to lookup Data Source at context java:comp/env/jdbc/MyConnectionDS
oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context java:comp/env/jdbc/MyConnectionDS
I made the JDev connection (used at development) invalid, and the deployed application stops working (at runtime). While it should just be using the JDBC DataSource defined on the WLS, that is still there. The reason appears to be that when there is no password in the Database Connection in JDev, the entry in the web.xml (see above) is not made during deployment.
I am doing something wrong? Or is this "expected" behaviour?
The reason why it bothers me: I have made a reusable component (a Data Control, let's call it A) from a model project, by deploying it to a ADF library JAR. I've set the AM of this project to use a certain jdbc datasource, which will be defined on the WLS.
When importing the library JAR of A inside another application (B), the connection of the A is added to B. But ofcourse, without the password for security reasons, so we're in the situation described above: When I deploy the new application B, the web.xml is not updated with the DataSource of A, and the application doens't work. And what I would like to avoid, is that whenever someone uses component A, that they have to update the connection details of component A in application B. Because when I fill in the password of application A's Database Connection in application B, all works well again.
I hope this question makes sense. :-)
Thanks in advance,
Chris

Arun and Krithika,
Thanks for your replies. I have already done what both of you suggested:
Chris Schryvers wrote:
I then uncheck "Auto Generate and Synchronize weblogic-jdbc.xml Descriptors during deployment" in the Application Properties > Deployment tab.I can get it to work, both for deployment on the internal WLS as on a stand-alone WLS.
My only question is: why does a property at development time (the empty password of the JDev connection) influence the runtime behaviour (the JDBC DataSource not being found after deployment).
Ofcourse, setting the password for the connection in JDev "solves" the problem. But I want to avoid that everyone who uses the reusable component needs to fill in the password for its database connection. In my opinion, that's the whole point of using a JDBC datasource instead of a JDBC URL: the reusable component just states that there needs to be a jdbc/MyConnectionDS on the server and it can be used as is. Wihtout any modifications at development time.
What's more:
Suppose I import the reusable JAR and its connection is added to JDev, without password.
*) Leaving the password empty: DS not found after deployment (web.xml not adjusted, as mentioned in my original post)
*) Entering the correct password: DS found, web.xml adjusted at deploy time.
*) Entering an incorrect password: DS found, web.xml adjusted at deploy time.
It even works when I enter an incorrect password, which proves that the JDBC DataSource on the server is used, instead of the JDev connection. Then why is the web.xml not adjusted when the password remains empty?
Arun, I'll check the documention that you linked to, but this just seems like an weird decision in the implementation of JDev/ADF. :-)

Similar Messages

  • Can't use JDBC URL for multiple LDAPs

    ColdFusion 8,0,1,195765 Enterprise (Trial)
    We use Oracle OID (LDAP) instead of tnsnames.ora to resolve database connection strings. This is how I specify one LDAP JDBC URL. On the CF admin page, Server Settings, Java and JVM, ColdFusion Class Path is set to C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar. Under Data & Services, Data Sources, create a new source. Set JDBC URL to
    jdbc:oracle:thin:@ldap://mdaoid1.mycompany.com:389/mdad2,cn=OracleContext,dc=mycompany,dc= com
    where mdaoid1 is one of the two Oracle OID servers that resolve connection strings, and mdad2 is an entry in the two OID's sync'ed to each other. That works.
    According to many sources based on Google search for "space separated LDAP URLs", I should be able to add another LDAP server separated by space. Now I append " ldap://mdaoid2.mycompany.com:389/mdad2,cn=OracleContext,dc=mycompany,dc=com" (no quotes, added to indicate leading space) to that string. Upon clicking Submit, I get
    Connection verification failed for data source: orcl10g3
    java.sql.SQLException: For input string: "389 ldap:"
    The root cause was that: java.sql.SQLException: For input string: "389 ldap:"
    (orcl10g3 is the CF data source name I'm creating) Some say I need to replace space with %20 in the double LDAP URL. With %20, I get error
    Connection verification failed for data source: orcl10g3
    java.sql.SQLException: Io exception: JNDI Package failurejavax.naming.InvalidNameException: Invalid name: mdad2,cn=OracleContext,dc=mycompany,dc=com ldap://mdaoid2.mycompany.com:389
    The root cause was that: java.sql.SQLException: Io exception: JNDI Package failurejavax.naming.InvalidNameException: Invalid name: mdad2,cn=OracleContext,dc=mycompany,dc=com ldap://mdaoid2.mycompany.com:389
    Question: How do I add more than one LDAP server to the JDBC URL so I can achieve failover and load balance?
    Yong Huang
    yong321 at yahoo.com

    The message above was posted by me two years ago and was brought to my attention today. Here's a short update: The network team added a load balancer mdaoid in front of, and resolved to, mdaoid1 and mdaoid2 (in round-robin fashion). The problem described in this thread is bypassed because the JDBC URL can simply use one-OID format, in which mdaoid is used as the LDAP server.

  • How to use JNDI datasource instead of database connection settings JDev 10g

    Hi,
    In order to use the different database from other environments, we are not able to use the JNDI datasource configuration settings, all the time need to configure the database connection settings from JDeveloper by changing the database connectivity settings in the JDeveloper for each environment separately, need a solution on how to make the database connectivity unique using the JNDI datasource name for all the environments for database connectivity settings through the application server console rather than changing the database adapter configuration in JDeveloper.
    Please provide the update at the earliest. Your help is greatly appreciated. Thanks in advance..

    What are you not clear on?
    What you need to do is get your developers to conform to a database naming standard, as stated above, so if you have an oracle database that is for eBusiness Suite you get all developers to create a DB connection in JDev called, ora_esb as an example.
    When the developer creates a DB adapter this will create a JNDI name of eis/DB/ora_ebs. When the BPEL project is deployed it looks for the JNDI name in the oc4j-ra.xml file to see its connection details. If they don't exist then they use the developers connection details. The issue with this is that they generally always point to the development DB. It is best practice for the developers to remove the mcf settings in the DB adapter WSDL. This way if the JNDI name has not been configured it will fail.
    So when you migrate from dev-test-prod what you have is the JNDI name eis/DB/ora_ebs. The dev points to the dev instance of ebs, test points to the test instance and so on. This means that you don't need to adjust any code in the BPEL projects.
    cheers
    James

  • Dynamic JDBC URls at Runtime

    Hi Experts,
    I did my application in jdev 11.1.1.6 and deployed using Jdbc Url connections and it worked successfully (Actually I m working with 2 diff Database connectiosn in my application)
    But the thing is my company need me to do something like I should be able to dynamically use Jdbc url connections at runtime so that they want to have QA db and PROD db inside the application
    and dynamically change them itseems. (i.e I will have 4 Db in which 2 for QA and 2 for PROD)
    Is there a way where I can achieve them. If so help me out.
    Thanks,
    933601

    Hi,
    You could store the database URLs in a properties file in the app server filesystem, then look them up in the dynamic JDBC code before setting the session attributes. So your QA app server has a properties file containing the URLs for the 2 QA databases and the PROD app server has a properties file containing the URLs for the 2 PROD databases.
    If you want a single app server to talk to multiple sets of databases you could pass a parameter to the login screen. Based on this you decide which database(s) to connect to.
    Kevin

  • Trying to switch from JDBC URL - JDBC DataSource

    I have built and run a JHeadstart 10.1.2 application using JDBC URL defined database connections.
    I am now trying to switch to use JDBC DataSource definitions to make the database connection independant from the application so that the same ear file can be deployed to different application servers (dev vs test environments).
    I have tried changing the Connection Type of the Business Component:
    Configurations > Edit > Connection Type
    from the previously defined JDBC URL to a JDBC Datasource defined within the embedded OC4j Application server. After making the change, rebuilding and restarting the server it still retrieves information from the previously defined URL.
    Is there something I need to regenerate/rebuild/reconfigure?
    Thanks,
    Kevin

    Hi Steven,
    I've seen that article. It's quite detailed and certainly helped until I ran into a VerifyError something like:
    java.lang.VerifyError: (class: oracle/ord/im/OrdDocBase, method: create signature: (Loracle/ord/im/OrdDocBase;Loracle/sql/Datum;I)Loracle/sql/CustomDatum;) Incompatible object argument for function call at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:140) at oracle.jheadstart.util.BindingUtils.class$(BindingUtils.java:66) at oracle.jheadstart.util.BindingUtils.isIntermediaBinding(BindingUtils.java:169) at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.setBindingInputHandlers(JhsDataAction.java:1159) at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processUpdateModel(JhsDataAction.java:622) at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:508) at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:112)
    I found this forum posting helped me...
    Re: JHeadstart Deployment Issue
    I couldn't run the application in a standalone instance of oc4j 9.0.4 even after following the deployment instructions found in this and other posts. It wasn't until I came upon a JavaWorld article from 2001 about VerifyError...
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0615-howto.html
    I added -noverify to the startup arguments and the application ran fine.
    I admit I am a little concerned that I need to run without jar verification. Have you seen this before? Is there another way to deal with this?
    thanks,
    Kevin

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    Hello all,
    Could you possibly help me with provider-hosted app development/deployment process.
    We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
    In AppManifest.xml that we are deploying we have key instead of explicit URL:
    <App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
    SharePointMinVersion="15.0.0.0">
      <Properties>
        <Title>SomeTitle</Title>
        <StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
    If we use as
    https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
    /_layouts/appinv.aspx
    So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
    What did I miss?
    P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.

    hi,
    to deploy provider hosted app you need 2 things
    1. Client ID
    2. Redirect URL.
    What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
    Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
    inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
    Now if you upload this file it will work.
    To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
    public static class AppPackageHelper
    public const string StartUrlExpression = "{0}?{1}";
    public const string StandardToken = "{StandardTokens}";
    public static string Publish(string appPath, string ClientId,string StartUrl)
    string tempDir = string.Empty;
    string outPutFile = string.Empty;
    try
    string parentDir = System.IO.Path.GetDirectoryName(appPath);
    outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
    tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
    Directory.CreateDirectory(tempDir);
    int lastInd = appPath.LastIndexOf('.');
    string tempPath = string.Empty;
    string targetFilePath = string.Empty;
    string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
    FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
    File.Copy(appPath, cabPath);
    XDocument doc = null;
    string appManifest = string.Empty;
    using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
    appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
    ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
    manifestEntry.ExtractToFile(appManifest);
    doc = XDocument.Load(appManifest);
    XNamespace ns = doc.Root.GetDefaultNamespace();
    string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
    doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
    doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
    doc.Save(appManifest);
    if (manifestEntry != null)
    manifestEntry.Delete();
    zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
    int totEnt = zipArch.Entries.Count;
    for (int e = 0; e < totEnt; e++)
    if (zipArch.Entries[e].Open().Length == 0)
    //if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
    //zipArch.CreateEntry(zipArch.Entries[e].FullName);
    File.Delete(appManifest);
    if (File.Exists(outPutFile))
    File.Delete(outPutFile);
    File.Move(cabPath, outPutFile);
    return outPutFile;
    catch
    throw;
    finally
    if (System.IO.Directory.Exists(tempDir))
    System.IO.Directory.Delete(tempDir, true);
    return outPutFile;
    using System.IO.Compression.FileSystem.dll.
    Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
    So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
    if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
    on searching.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Proxy Authentication with JDBC Datasource instead of JDBC URL?

    Hello,
    A requirement for my current project (ADF 10g) is that a user should be able to log in with his regular database account. For the moment, this is implemented using Proxy Authentication, as described in the following article:
    http://blogs.oracle.com/jheadstart/2008/01/using_proxy_authentication.html
    For now, we are using a JDBC URL defined in the application module config for the BC. In short: a ProxyAuthConnectionPoolManager class was created that overrides the default ConnectionPoolManagerImpl. The getConnection method has been overridden to create a standard connection (with the username/pw defined on the AM), and additionally, create a proxy connection within this connection with the specific user credentials. The (simplified) code:
        public Connection getConnection(String key, String url, Properties props, String username, String pwd) {
            // first fetch a default connection from the pool through the superclass
            Connection connection = super.getConnection(key, url, props, username, pwd);
            // cast into an OracleConnection
            OracleConnection oraConnection = (OracleConnection) connection;
                // close any proxy sessions that would still exist on the connection
                if (oraConnection.isProxySession()) oraConnection.close(OracleConnection.PROXY_SESSION);
                // get a handle on the session scope
                Map sessionScope = ADFContext.getCurrent().getSessionScope();
                if (sessionScope != null) {
                    // find the user object in the session (the account the user logs in with)
                    ProxyAuthUser user = (ProxyAuthUser) sessionScope.get(ProxyAuthUser.JHS_USER_KEY);
                    if (user != null) {
                        // create a property map with the end user credentials
                        Properties proxyProps = new Properties();
                        proxyProps.put(OracleConnection.PROXY_USER_NAME, user.getDbUsername() + "/" + user.getDbPassword());
                        proxyProps.put(OracleConnection.PROXY_USER_PASSWORD, user.getDbPassword());
                        // open the proxy session
                        oraConnection.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, proxyProps);
                return oraConnection; 
        }Now, this works perfectly when using a JDBC URL. But when I switch the JDBC Datasource the ProxyAuthConnectionPoolManager class is not called anymore. This is all done in code in the Application Server. While using a JDBC Datasource is actually necessary: otherwise for each environment (dev, test, production,...) a different WAR file is needed.
    What class can I override with code similar to the piece above, to open a proxy connection inside the existing connection, when using a JDBC Datasource?
    Your help would be greatly appreciated!
    Chris

    Hello Krasimir,
    Frank Nimphius gave me the solution to this problem. The prepareSession is indeed the best place to put the code:
       private OracleConnection oconn = null;
       public void prepareSession(SessionData SessionData) {
          super.prepareSession(SessionData);
          oconn = ((PrxyTransactionImpl)this.getDBTransaction()).getPrxyConnection();
          // Specify the user that connects through the proxy user and its roles
          Properties prop = new Properties();
          prop.put(OracleConnection.PROXY_USER_NAME,"hr");
          prop.put(OracleConnection.PROXY_USER_PASSWORD,"hr");
          //prop.put(OracleConnection.PROXY_ROLES, roles);
          // Open the proxy session (DB-authenticated users)
          try {
             oconn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, prop);
          catch (SQLException e) {
             // Close the connection, to avoid connection to remain open after exception
             oconn.abort();
             e.printStackTrace();
       }But Frank also created the following helper classes to extend the ADF BC behavior:
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jbo.server.DatabaseTransactionFactory;
        * TransactionFactory that returns PrxTransactionImpl, which is a subclass of
        * DBTransactionImpl2
        * @author Frank Nimphius
       public class PrxyDatabaseTransactionFactory extends DatabaseTransactionFactory {
          public PrxyDatabaseTransactionFactory() {
             super();
           * Override the create method to return an instance of PrxyTransactionImpl instead
           * of DBTransactionImpl2
           * @return PrxyTransactionImpl
          public DBTransactionImpl2 create() {
             return new PrxyTransactionImpl();
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jdbc.internal.OracleConnection;
       public class PrxyTransactionImpl extends DBTransactionImpl2 {
          public PrxyTransactionImpl() {
             super();
           * The DBTransactionImpl2 does not expose the connection in a public
           * method. This class is a wrapper to expose the connection to the
           * BC app, so it can be accessed in the ApplicationModuleImpl class
           * @return OracleConnection - SQL Connection
          public OracleConnection getPrxyConnection() {
             return (OracleConnection) this.getJdbcConnection();
       }In the configuration of your Application Module, you have to set the property "TransactionFactory" (normally the last one in the list) to oracle.sample.dbprxy.adfbc.PrxyDatabaseTransactionFactory. This way, the DBTransaction() of your AM will have a getPrxyConnection() method and you will have the connection at your disposal. You won't need the createPreparedStatement in your code anymore.
    To close the connection, this is the code behind my "logout button" on the backing bean. Application Module Pooling and Connection Pooling will take care of the rest for you!
       ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
       HttpSession session = (HttpSession)ectx.getSession(false);
       session.invalidate();Another thing: be sure to set the internalconnection property to a different JDBC Datasource (or file based) than the one you are using to connect to the database (the default value). Otherwise connection pooling will be confused and there will be too much pending database connections.
    This works for me, all sessions are closed in time and logging out seems secure. I do not have my complete, adjusted code here at my disposal, but next week, when I'm back at work, I'll have a look to see if there is anything I forgot to mention. So this should get you started, but I'll keep you posted!
    A huge thank you to Frank again for helping me (/us) out with this problem!! And sorry I forgot to post the answer here sooner. I was too busy with testing it. :-)
    Regards,
    Chris

  • REDIRECT JDBC URL WHEN USING DYNAMIC JDBC CREDENTIALS SO NOT HARDCODED

    I have taken over an application that uses row-level security and ADF (using
    dynamic JDBC Credentials). I have been able to set the internal_connection to
    a JDBCDatasource, but cannot set the Connection Type in the Oracle Business
    Component Configuration to a JDBCDatasource. When I do, I receive errors that
    tables are not found. When I set the value back to a JDBC URL, everything
    works fine again.
    I am looking for a solution where the userid and password are not hardcoded in
    the BC4J.xcfg or a way to redirect this information, as we change our system
    passwords every nighty days. Otherwise, I will have to redeploy the
    application every nighty days.
    I did not create this application, but I am sure that you could simply follow
    the "How to Support Dynamic JDBC Credentials" article. From that point, you
    will probably be where I am, where I have the internal_connection set to a
    JDBCDataSource and working properly, but cannot set the Connection Type to
    anything where the userid and password will not be hardcoded or cause failure.
    I wanted to let you know that I have
    found the updated How to Support Dynamic JDBC Credentials
    (http://www.oracle.com/technology/products/jdev/howtos/bc4j/howto_dynamic_jdbc.h
    tml) and was going to run through the "Advanced: Supporting Dynamic JDBC URLs",
    but once I was done keying in
    env.remove(ConnectionStrategy.DB_CONNECT_STRING_PROPERTY); I received a
    depreciation message on the DB_CONNECT_STRING_PROPERTY. (Note: I am coding in
    JDeveloper 10.1.3, so this may be depreciated as of then, but the ADF Libraries
    for JDeveloper 10.1.3 are on our Oracle 10gAS 10.1.2 server.)
    I thought maybe this would resolve my issue, but I can't be sure as the
    deprecation message leads me to believe that this solution may not be viable in
    the future.
    UPDATE
    =======
    The article you are referencing is definitely an older version.
    There is a newer article for 10g at:
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
    Please see if that helps.
    I have already reviewed this article.
    In fact, I have reviewed many versions of this document. I have not seen one
    created yet for 10.1.3 though (especially without JSF as our 10.1.2 AS server
    will not support it). I need to find an example or documentation that shows
    how we can keep from having the JDBC URL stored in the BC4J.xcfg or a way to
    use dynamic JDBC credentials with a JDBCDataSource. We do not want to store
    the userid and password in the application, rather, we would like to setup
    something that can be configurable from the application server.
    I think we need to use the dynamic JDBC credentials because we are using the
    row-level security, where we setup a database context for the user and only
    allow certain records of a database table to be returned to the browser based
    on that context.
    Might there be a way to still use the JDBCDataSource?

    I understand that the user provides the userid and password and that these values are setup using the Configuration class.
    However, when I am to deploy the ADF Business Module with my application, I have to specify either a JDBC URL or a JDBC DataSource in the Oracle Business Component Configuration.
    When I use JDBC DataSource, the code does not work properly, almost like the user's credentials are not used for the connection (I get errors like table or view does not exist).
    When I use the JDBC URL, the bc4j.xcfg stores a reference in the JDBCName attribute to a ConnectionDefinition in the same file. It is in this tag of the bc4j.xcfg where the userid, sid, and password (encrypted) is stored and used when retrieving the initial context of the ADF business components.
    It is these values that I want to have stored else where so that the application does not have to be redeployed in order for the password (or sid, or other connection information) to be change.

  • JDBC Connection Using ColdFusion DataSource

    We are using ColdFusion MX 6 and oracle 10g.
    I am trying to code a JAVA JDBC database connection class by
    simplely pass ColdFusion datasouce name.
    i.e, instead of passing URL, user id and password, I hope my
    JAVA class can recognize ColdFusion datasource.
    Is this possible without a J2EE environment?
    If you have done this, please advice.

    DataSource is an interface which allows vendors and developers to implement their means of managing Connection objects (to add features like connection pooling, etc). You can find out about DataSource in API documentation: http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html
    DriverManager on the other hand is a class which registers Drivers and uses them to produce Connection objects:
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DriverManager.html

  • Correct JDBC url using IPC protocol

    What is correct url to connect to db with orcl SID using IPC protocol? Couldn't find this in documentation....
    jdbc:oracle:oci:@[WHAT GOES HERE?]

    If you are having problems with TCP then you should find and fix those problems. Many thousands of others use TCP with, and without, Glassfish and it works just fine for them. That indicates you have an issue with one, or more of those four things I ask you to provide but chose not to.
    Fix would be to upgrade DB to 12.1.0.2 or downgrade to 11, where I haven't got any problems with connection pool.
    SHOW US (don't just tell us):
    1. WHAT you are doing - that means posting the code and ALL relevant info about TNSNAMES and other properties/settings being used such as connection pool settings.
    2. HOW you are doing it - that means showing a copy of the console that shows the LAUNCH and EXECUTION of the code
    3. WHAT results you get - that means showing a copy of the console showing any results or exceptions you are getting
    4. WHAT results you expected to get
    You should also do basic troublshooting:
    1. confirm that you can connect to the DB without using JDBC
    2. confirm that you can connect and work properly WITHOUT using a connection pool
    That other link you provided shows pool settings that are pretty much guaranteed to cause the pool to close connections. An idle timeout of only 60 seconds greatly increases the possibility that a connection that is checked out of the pool and still in use may get closed if it isn't returned to the pool properly.
    This link describes the attirbutes  and their defaults:
    https://docs.oracle.com/cd/E19316-01/820-4338/abhcy/index.html
    You are using SEVERAL non-default settings - and you are having a problem. That suggests you should go back to the defaults and test again.
    We can NOT see your computer screen or SEE what you are doing. We can NOT debug code that we can't see.
    Are you a bot? Or are you using some replay templates? Have you read my first post? Do I ask for help in debug any code? What code you are taking about? I ask for proper url using OCI driver over IPC protocol.
    This is my tnsnames.ora
    ORCL_IPC =
      (DESCRIPTION =
        (ENABLE = BROKEN)
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(Key = ORCL))
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ORCL)
    and jdbc config
    <jdbc-connection-pool validation-table-name="DUAL" datasource-classname="oracle.jdbc.pool.OracleDataSource" max-pool-size="50" res-type="javax.sql.DataSource" steady-pool-size="10" statement-cache-size="100" name="c2onlinePool" statement-timeout-in-seconds="30" is-connection-validation-required="true" idle-timeout-in-seconds="7200" max-wait-time-in-millis="10000" validate-atmost-once-period-in-seconds="60">
          <property name="driverClass" value="oracle.jdbc.OracleDriver"></property>
          <property name="user" value="***"></property>
          <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521/orcl"></property>
          <property name="password" value="***"></property>
          <property name="portNumber" value="1521"></property>
          <property name="databaseName" value="orcl"></property>
          <property name="serverName" value="127.0.0.1"></property>
    </jdbc-connection-pool>
    which is working (I'm testing with ping from glassfish web console), I just want to switch to IPC protocol.
    I tried with
    jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY = LISTENER))(CONNECT_DATA=(SERVICE_NAME=orcl)))
    jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ORCL)))
    but every time JVM crashes with stackoverflow, as soon as I click on ping in console.
    Maybe it's just another driver bug. I have similar situation with thin driver - version 12.1.0.1 didn't work, but version 12.1.0.2 worked ok.

  • Problem using JDBC (JNDI) DataSource and data-sources.xml w/ OC4J

    I have a JClient application developed in JDev X. It works fine when using a JDBC URL for the connection (which then writes the connection into the BC4J.xcfg files, one for each application module). However, I would like the app to retrieve the data source from the server's data-sources.xml file. However, when, on the configurations tab of the application module I set the connection type to JDBC DataSource, and give it the JNDI name, it does not work, either with the embedded OC4J or the stand-alone OC4J. Any suggestions???
    In the stand alone OC4J I verified that the data source exists (using java -jar admin.jar ormi://nemethzoltan3 admin welcome -application adatklinika -testDataSource -location jdbc/adatklinikaCoreDS) ... so the data source is defined in the data-sources.xml. Of course the error I get is JBO-30003.
    If I just try to "test" the data source in Jdeveloper (using the context menu of the app module, and setting it to use the adatklinikaCoreDS) I get a JNDI error: unable to lookup data source and at level 3 a "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial". I checked, the data source is defined under tools->embedded OC4J properties->data sources.
    If I try to run the main form, simply nothing happens.
    Please help!!!

    Ok, figured out why running from jdeveloper wasn't working: the embedded OC4J server wasn't started (start it by running an html page from your project or something...and make sure you don't have a stand-alone oc4j running). AND more importantly it didn't have the library "embedded oc4j client" library included (project properties -> profiles -> development -> libraries)...which is needed for whatever reason.
    Now to try and get it working with the stand-alone OC4J...

  • WILL using JDBC API instead of LookUp APIs  hamper performance?????????????

    hi forum experts,
    i have done a JDBC call in a UDF in a message mapping to fetch some records from a database,
    i tried doing it with LookUp APIs,  but i think/found that LookUp APIs dont provide
    any method to execute DML statements, and moreover these APIs dont provide transactional behaviour....
    so i tried with JDBC APIs.......<<<<java.sql.*;>>>>.....where i used custom code to provide transactional behaviour........like explicitly using commit() methods. Where i m using Connection class...and in this case XI communication channels are not being used,,,....
    will using JDBC API instead of LookUp APIs hamper performance????????????

    Hi Sudeep,
    This will surely help u,
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    /people/william.li/blog/2007/03/30/using-jdbc-connection-pool-in-xi-message-mapping
    According to help.sap
    Use of Lookup API - Calls to other application systems are sometimes necessary to meet the following requirements:
    &#9679;     To get <b>read </b>access to application system data in the mapping program
    &#9679;     To call existing mapping routines in the application system
    So DML statements couldnt be used
    Additional help
    /people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
    <i>[Reward if helpful]</i>
    Regards,
    Prateek

  • How to use jndi datasource on Weblogic instead of adding a DB data source

    Hi All,
    version: 11.1.1.4
    I am trying to figure out how in my ADF applications I can use an existing jndi datasource out on our weblogic servers instead of having to bury the Database db source in my adf applications. Like SOA I would like to reference the DB directly during design so I can pull in entities and build view objects, but when I deploy I want it to reference the jndi datasource out on the weblogic server.
    Is this possible? If so I am not sure how to configure it like I would a DB adapter in SOA.
    As always appreciate the info.
    Thanks,
    S

    If you use ADF in the model layer (application modules) you can configure them to use JNDI Datasources. Just right click on the application module and select 'Configurations...'. In the next dialog you see all the configurations currently available (one named xxxxxlocal and one named xxxxxshared at least). Select the local and hit the edit button. This open the DB connect dialog where you can change the connection from JDBC URL to JDBC Datasource (JNDI). Save your work and when you now start the app it will use the JNDI name.
    Timo

  • Help: Connecting Tomcat to CA-IDMS Using JDBC Type 4 Drivers (JNDI)

    Hi there,
    I have a rather interesting / complex problem......creating a connection to CA-IDMS from Tomcat using JDBC type 4 drivers (CA provide the type 4 driver).
    We have a zSeries 9 IBM mainframe running CA-IDMS r16.1, and I need to connect to the IDMS from Tomcat (running on Linux) using the JDBC Type 4 drivers provided by CA.
    At this stage I am struggling with the actual setup and configuration of Tomcat’s server.xml and web.xml files. These are the files where the JDBC configuration is set (I think). I have to setup the CA-IDMS part of the configuration, but that is a different problem. Basically there is a TCP/IP listener on the IDMS, waiting for incoming connections from the JDBC type 4 driver.
    I set up a Tomcat to MySQL connection using MySQL Connector / J, which is a similar kind of process to what I am trying to achieve with IDMS. MySQL connector / J came with a jar file which is placed in Tomcat’s lib folder, and then the JDBC setup for the web application is created in Tomcat's server.xml and web.xml files. You can then connect to the MySQL database using JSP and the configured JDBC driver / connection. The CA-IDMS Server comes with an idmsjdbc.jar file, which I think is the JDBC typr 4 driver. I think it needs to be placed in the Tomcat /lib folder, but I don’t know how to set up the configuration.
    There is a JDBC DriverManager which allows JDBC drivers to connect to CA-IDMS. The DriverManager recognises the following syntax:
    jdbc:idms://hostname:port/database
    This allows the JDBC driver running within Tomcat to connect to the IDMS which is running on the IDM mainframe. CA IDMS r16 supports direct connections from the Type 4 JDBC driver to the Central Version on IDMS. "hostname" is the DNS name or IP address of the machine where the CV is running, and "port" is the IP port that was specified for the listener PTERM (setup on the IDMS side).
    There is a caidms.properties file for the JDBC driver, which is used to specify user ID, password, and optional accounting information. It can also be used to specify physical connection information, allowing an application to connect to a CA-IDMS database without requiring the definition of an ODBC style data source. However, I don’t know where to place this file within the Tomcat setup.
    There is also an IdmsDataSource class. I don’t know where to configure this or how to set it up; the CA-IDMS Server manual states the following:
    This class implements the JDBC DataSource interface. It is used with an application server (Tomcat) providing Java Naming and Directory Interface (JNDI) naming service to establish a connection to a CA IDMS database. IdmsDataSource properties conform to the Java Beans naming conventions and are implicitly defined by public “setter” and “getter” methods. For example, the “description” property, which is required for all DataSource implementations, is set using the setDescription(String) method. The application server may use the java.lang.reflection methods to discover DataSource properties and provide an interface to set them, or may simply require that they are defined in some configuration file. IdmsDataSource properties are used to specify the connection parameters. These properties are the equivalent of the DriverPropertyInfo attributes described in the previous section and can be used to completely define the parameters needed to connect to a database. Like a URL, an IdmsDataSource object can also reference an “ODBC” style data source name, where the connection parameters are defined in the configuration file on Linux.
    Is there anyone that can try to point me in the right direction to setting up the JDBC connection? I am totally new to Java and so the instructions are not making much sense at the moment. Any help, hints, tips…..anything will be greatly appreciated as I have just hit a brick wall here. I can't find much to do with setting up the CA-IDMS Server JDBC type 4 driver online either....if anyone can point me to some resources that would also be extremely useful.
    Kind regards
    Jp

    You say you've managed to get the JDBC driver working
    in an application but not in a JSP. You also say that
    the error you get is
    "com.microsoft.jdbc.sqlserver.SQLServerDriver".
    I'd be willing to bet that the exception that you have
    got is a ClassNotFoundException. I.E. your application
    server hasn't found the JDBC driver classes. The
    application server probably doesn't use your current
    CLASSPATH to look for classes. It will be setup within
    the application server in some way and you'll need to
    check your app server documentation to see how it is
    done.
    Try replacing
    e.printStackTrace();with
    e.printStackTrace(out);to get a full stack trace of your error.
    ColTried it. Got this error when I tried to run the JSP.
    Incompatible type for method. Can't convert javax.servlet.jsp.JspWriter to java.io.PrintWriter.
              e.printStackTrace(out);
    I'm currently using Apache Tomcat 4.0.3 as my JSP/Servlet Container.
    I'm also using Type 4 MS SQL Server 2000 JDBC driver version 2.0 on my NT4.0 Server.
    Do I need to set my JDBC driver in my container? if so, how do I do that?

  • Opinion of creating s/w for using JDBC

    Hi,
    Can anyone pls give opinion regarding this case.
    I plan to create a JDBC s/w which is used to connect to linux server.The Database that i m going to use is mySQL for storage and use red hat linux 9.0 for client platform.
    My questions are :
    1) I have to install the JDBC s/w in three different places and insert or retrieve data from DB(DB is placed in another place).What kind of JDBC s/w should i create?Is it just create normal JDBC s/w and set URL in Properties file in order to connect to DB?
    2) What is the different between J2SE(in writing s/w) and J2EE?
    3) Can i use J2SE to write this s/w?If no,pls give some opinion.
    4) What are the possibilities/better ideas(including technologies that i use) that i can do in order to implement this client/server system?
    Thanks in advance for replying this message.
    Regards,
    marcalena

    Hi duffymo,
    I appreciate for your opinions.
    Yes i agree with your ideas/opinion.Three app need to update immediate to centralize DB in order to update latest information.I know the important of this.
    Can i do it in this way?
    Three app is connected to Internet,but i am not going to create app in JSP/Servlet,since i am not that familiar with those technologies.
    My idea of creating these 3 app are instead of using JSP/Servlet i create app by using J2SE technologies.Yes they will be connected to Internet,for certain purposes(for instance update latest information to centralize DB) i would use java.net package which set URL that could point to centralize DB and update/retrieve information instead of using JSP/Servlet).Then the rest of the features which are provided by app i will make it offline(features that are used within a branch,besides of updating latest information to centralize DB).
    So the scenario will be:
    Each app does its own jobs offline(like calculation,make reservation and etc),but when app needs to update/retrieve latest
    information,i would use java.net to fulfill the purposes.
    My question are:
    1) Is my idea good enough to make app work?If no,that means i really need to use JSP/Servlet to accomplish those tasks,can you give me ideas of creating app(overall picture of network architecture,and the ways of how they are interacted).
    Thanks in advance for duffymo.
    Regards,
    marcalena

Maybe you are looking for

  • Date is not working in Xcelsius

    Hi, I am takeing data in Xcelsius from SAP BI,I have created a Universe and then Qaaws,In Qaaws all results showing correctly,but when i see the same data in Xcelsius,its showing date wrong. How i can get the correct date which is transfered from SAP

  • Is incredible , i can repair my mac book pro for the graphic schedule

    I can't believe , is impossible to repair my mac book pro sn W87100M2W0L, BECOUSE IS VINTAGE AFTER 5 yers, hope the Apple give me a solution, i'm worry, and if isn't possible to repair i close with Appke and all the products who i have, sorry for my

  • Error message in PSE 13

    I have been getting "could not complete your request because of program data error" messages when trying to open images in PSE 13.  I also can't run certain functions at times because it says I do not have enough RAM.  I have a brand new computer and

  • Photos missing after thumbnail cache rebuild

    I upgraded to ilife 08' and rebuilt my thumbnail cache in iphoto after it prompted me to do so. my photos are still on my hard drive in the "originals" folder and I can see the titles and outlines of where the albums should be when navigating through

  • Recommend me a good drag and drop tutorial

    I need to make a movie whereby the user drags four items onto 4 targets and achieves a result as each object lands on the target, such as a sound. and then a well done statement at the end. Can anyone recommend me a place where I can download such a