Different database connections

Hi,
I have a problem in an application with two different database connections.
I divided it into three projects one is the model project for a mysql database, one I the model project for an mssql database and one is a jsf project.
But I only can use the first database project I add to the jsf project.
If I use the other SessionFacade he uses the wrong database driver.
My question is, is it possible to access two different databases out of one project?
Thanks,
John

Does anyone know how to do this?
I need the same, but i couldn't find any documentation about it.
Looking forward to hearing good news.....

Similar Messages

  • How to add two different database connections on Model

    Hi,
    In my application, I need to create View Objects on different databases. So I need to add two different database connections on the Model.
    But it seems like Model can be connected to only one database. I tried adding another project to add the second db connection. But after I created a read-only View Object in the second project, it didn't generate corresponding data control in the Data Controls panel.
    Could anyone help me on this?
    Thanks!

    Do you mean adding the second project folder in ViewController->Project Properties->Libraries and Classpath?Yes, either that or: ViewController -> Project Properties -> Dependencies
    And I didn't see the first Model project in the ViewController classpath. Otherwise it wouldn't work. The first model project IS in 'classpath'. Here's how:
    ViewController -> Project Properties -> Dependencies
    I tried this and recreated the View Object. Still didn't generate the datacontrol. No idea why you had to recreate the VO.
    Is your VO in an application module inside the SECOND project?
    After you are sure that everything is in the ViewController's classpath, just try restarting JDeveloper.
    This is very basic. has to work.

  • How to host one application using different database connection on OAS?

    Hi,
    Jdeveloper - 10.1.3.4
    Application - ADF/BC
    Oracle Application Server - 10.1.3
    Above our the specifications for our application,
    We have two database schemas different for development and production therfore we have different databse connections for the two,
    we have one application which is in production and enhacements on the same application are done by the development team.
    Since we have two different schemas for developement and prduction we use different database connections for the application on development and production.
    The problem is our Model and View Controller project are same, only the database connection file changes that's why we are able to host only on application at a time on our OAS. This is probably because the URL generated by OAS for developemnt and prodyction application is same.
    Is there a way we can host two instances of the same application with two different database connections on the a single OAS.
    Thanks & Regards,
    Raksha

    Use different deployment profiles each with a different context root for your application?
    See: http://one-size-doesnt-fit-all.blogspot.com/2009/02/configuring-separate-dev-test-prod-urls.html

  • Different database connections at runtime

    How can I change different database connections at runtime on the same Application Module ?
    I use BC4J as business layer and uiXml as presentation layer.

    Does anyone know how to do this?
    I need the same, but i couldn't find any documentation about it.
    Looking forward to hearing good news.....

  • Different database connection or proxy user change

    Hi forms guys,
    in everyday life I am fulltime DBA, so please forgive my spare forms word pool.
    Our users open a forms application that displays a menu with forms applications the user has access to. Users can then click on the menu items and another form pops up. Now having reviewed the code, I can say that the opening of the new forms is done by calling the builtin OPEN_FORM. As parameter "SESSION_MODE" for this function, "SESSION" is supplied. If I understand correctly, this means that another session using THE SAME username/password/connectionstring is created (for the purpose of parallel transactions in parent and child form).
    At the moment each and every user (~400) has it's own database account which has roles (depending on the applications they are granted access to) assigned and also sometimes owns dblinks and synonyms. We want to get rid of them by storing the credentials in OID and just create ONE single application user for every application we host. This user shall contain all nescessary objects such as dblinks and private synonyms.
    The enduser then logs in using the proxy mechanism. For example if user XYZ (defined in OID) wants to start application ABC, then he/she connects like XYZ[ABC_APPUSER]/XYZPASSWD. This must occur when the form opens, directly after the OPEN_FORM call.
    Now my question: Is this possible somehow? Is there a way to have different database connections within a single forms window, if there are different forms? Or is it possible to make a switch to another proxy user within forms? e.g. JDBC has the ability to quickly switch to an other proxy user, without having to re-establish the whole session.
    All I have read so far tells me, that it is not possible. But I would really like to hear that acknowledged by experts. Also other, perhaps better ideas for our intention are welcome.
    Kindest regards
    Matschbirne

    Not really sure how to answer your question other than to say that from within your form's pl/sql you can connect and disconnect as often as you like programatically. However, you can only have one connection at a time (as far as I know). So if you connect as SCOTT and later want to do a login as FRED, you can do so, but SCOTT will no longer be connected.
    Forms does support using Oracle SSO, but for the most part cannot directly access OID. Also, the db login information needed by Forms (when using SSO) is stored in a RAD (Remote Access Descriptor) in OID. The RAD behavior is unique to Forms and Reports. For each SSO user there is a related RAD. At the moment, there is no provided way to have RAD groups (e.g. Admin, Sales, Guests, etc). So each user get their own RAD.
    If you are using Forms 11.1.x, Forms now supports db proxy users.
    More information about SSO and Proxy users with Forms can be found in the Forms Deployment Guide:
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/sso.htm
    In the code, you can control the connection using the LOGON, LOGOUT, and LOGON_SCREEN built-ins. Refer to the Forms Builder online help for details on how to use these.

  • Date dimension fragmentation from 2 different database connections

    Hi Everyone,
    In obiee 10g, is it possible to implement fragmentation on a date dimension from 2 different physical database connections (not schemas)?
    For example:
    Physical connection & dimension 1: physical1.obiee_rpd.w_mcal_day_d.date
    physical connection & dimension 2: physical2.obia_rpd.w_mcal_day_d.date
    the fact table will be: physical1.obiee_rpd.w_fact_f.fact
    The 2 physical dimension tables will be joined to the 1 fact table in the physical layer.
    I then create a BMM with 2 LTS : physical1.obiee_rpd.w_mcal_day_d and physical2.obia_rpd.w_mcal_day_d.
    I then create 1 logical column in that BMM which sources both physical1.obiee_rpd.w_mcal_day_d.date and physical2.obia_rpd.w_mcal_day_d.date.
    Then, i set up fragmentation to use physical1.obiee_rpd.w_mcal_day_d.date when physical1.obiee_rpd.w_mcal_day_d.date < '04/30/2012' and use physical2.obiee_rpd.w_mcal_day_d.date when physical1.obiee_rpd.w_mcal_day_d.date >= '05/01/2012'.
    The problem is that the query that answers generates always uses physical1.obieerpd.w_mcal_day_d.date , regardless of the date filter applied!_
    Any tips?
    Thanks!

    Hy,
    Can you try the following.
    Define:
    - one logical date dimension with two logical table sources (physical1.obiee_rpd.w_mcal_day_d.date and physical2.obia_rpd.w_mcal_day_d.date)
    - one logical fact table with two Logical Table Source (LTS). And in each LTS, define the same logical level in the content tab and don't forget to check the checkbox "This source should be combined with other sources at this level".
    Cheers
    Nico
    Edited by: gerardnico on Jun 25, 2012 4:23 PM Date and not datum (Dutch)

  • FR Studio - Is there a workaround for the issue with referencing data from a grid with a different DB connection and different # of dimensions?

    Hi,
    I am trying to reference a column in a different grid with a different database connection. I did some research in the forums, and it seems like this is a known issue with FR Studio. The issue is that if the 2 different database connections have different # of dimensions, then the reference will throw an error.
    For example, what I'm trying to do is below:
    In grid2.column[A], I have the following formula:
    grid1.column[A]
    The result is an error.
    The ultimate goal is to have a basic variance formula in the grid between grid1 and grid2, which have different database connections with a different # of dimensions. Is there a workaround at all to this bug? The example of the basic formula is below:
    grid1.column[A] - grid2.column[A] 
    Any help is much appreciated!
    Thanks,
    Tiffany

    Thanks for the detailed response Mike.
    The issue with trying it in Grid1 vs Grid2 is that Grid1's DB connection has more dimensions than Grid2's DB connection. I can't change the DB connection to a database with more dimensions because you have to be able to map all dimensions from the existing DB connection  (Grid1) to the new DB connection (Grid2). This isn't possible, so instead I have to map Grid2 (less dimensions) to Grid1 (more dimensions). It just ignores the extra dimensions from Grid1. Does that make sense?
    Thanks again for your responses. It's very much appreciated.
    Tiffany

  • 1 application 2 ejb 2 database connections

    Hello all.
    I have one application with 3 modules.
    1 web module with jsps, working with ADF and jsf.
    2 ejb modules, each one I need to connect to a different database.
    The problem is that the 2 ejbs are connecting to de first module's database, so the second ejb is not able to find the tables mapped to the entities.
    How can I configure this 2 ejbs to connect to one databes each?
    Thanks in advance.
    Marko.

    Hi,
    what if the JNDI lookup is done within the session bean ? As I see it, the only way out of this is to handle the different database connects and transactions manually. EJB does not provide you and option for this
    Frank

  • Database Connection design question

    Hello, I have a design question. Awhile back I needed to create a database connection to SQL Server, so I created a class to do it
    import java.sql.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class SQLServerConnection
         private static Connection connection = null;
         public SQLServerConnection(String user, String password, String dbName) throws java.sql.SQLException
              getDBConnection(user, password, dbName);
         public SQLServerConnection(String configFileName) throws java.sql.SQLException
              getDBConnection(configFileName);
         private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
             connection = DriverManager.getConnection(
                  "jdbc:microsoft:sqlserver:" + dbName, user, password);              
         private void getDBConnection(String configFileName) throws java.sql.SQLException
              String user;
              String password;
              String dbName;
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   Document doc = db.parse(configFileName);
                   doc.getDocumentElement().normalize();
                   // get the configuration information
                   password = getConfigParameter("password", doc);
                   user = getConfigParameter("username", doc);
                   dbName = getConfigParameter("databasename", doc);
                   getDBConnection(user, password, dbName);
              catch (MalformedURLException murle)
                   System.out.println("Unable to connect to: " + configFileName + " -- " + murle);
                   System.exit(1);
              catch (FileNotFoundException fnfe)
                   System.out.println("Configuration file " + configFileName + " not found.");
                   System.exit(1);
              catch (IOException ioe)
                   System.out.println("IOException: " + ioe);
                   System.exit(1);
              catch (javax.xml.parsers.ParserConfigurationException pce)
                   System.out.println ("Parser Configuration Error: " + pce);
              catch (SAXException saxe)
                   System.out.println ("SAXException: " + saxe);
         private String getConfigParameter(String paramName, org.w3c.dom.Document doc)
              NodeList nl = doc.getElementsByTagName(paramName);
              if(nl != null)
                   Node n = null;
                   for (int i = 0; i < nl.getLength(); i++)
                        n = nl.item(i);          
                        if(n.hasChildNodes())
                             NodeList children = n.getChildNodes();
                             return ((Node)children.item(0)).getNodeValue();
              else
                   System.out.println ("nl is null");
              return "";          
         public void setCatalog(String catalogName) throws java.sql.SQLException
              connection.setCatalog(catalogName);
         public Connection getConnection()
              return connection;
         public void closeConnection()
              try
                   connection.close();
              catch(java.sql.SQLException sqle)
                   System.err.println ("SQL Server Connection failed to close: " + sqle);
    }Later on, I needed to do the same thing for MySQL, so I created a class for that, MySQLServerConnection which is exactly the same as above, except for:
    private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   connection = DriverManager.getConnection(dbName, user, password);     
              catch(java.lang.ClassNotFoundException cnfe)
                   System.out.println (cnfe);
              catch(java.lang.InstantiationException ie)
                   System.out.println (ie);
              catch(java.lang.IllegalAccessException iae)
                   System.out.println (iae);
         }Later, on, I did the same thing with OracleServerConnection. My question is, I know this is probably not optimal code. For example, I didn't originally have a close connection method, so I had to go in and code one for all 3. I'm assuming that an interface would be a good idea so that if I have to code another database connection class I make sure and include all of the appropriate methods. I'm also assuming that it would have been smart to have a master class, maybe something like DatabaseConnection and extended these classes from that. Am I on the right track? Totally offbase?

    @nclow - I will work on trying the Factory Pattern for this over the weekend and post when I finish to see what you think.
    @abillconsl - just to make sure I understand, you're saying that I just try to connect and it will cycle through the different database connection possibilities and connect when it finds the right one? If it fails all 3, log an appropriate message. One question I have about this is, I thought I was being object oriented by separating the different types of db connections (Oracle, SQL Server, MySql) into different classes. Am I missing the point of OOP by what I was/am trying to accomplish? Going overboard? Also, does your way try and connect to all 3 even if I connected to one already?
    Thx, Grantarchy
    Edited by: grantarchy on May 9, 2008 9:50 PM

  • How can I connect to a different database schema,other than adobe?

    I'm building an application where I want to use a different database for it,for storing additional data for the users(different from "edcprincipaluserentity" table in "adobe" database stores)..How I can connect to my database schema created in MySQL from Workbench,to assign tasks to my users,using the Process Management/Assign Task service?

    You can only assign task to user that are known by the LiveCycle User Manager.
    When you configure LiveCycle, you can tell it where you want to get the users from. They can be created them locally in the local database, or synchronized from an LDAP directory in which case it'll read the users from LDAP and make a copy of some of the properties to the internal LiveCycle database.
    Bottom line, all users have an id (in the edcprincipalentity table) in the adobe database.
    If you need your users to come from a different database, then you need to customize the SPI (security provider interface) so that you can synchronize the users coming from your external database. Again, this is a customization since out of the box, we don't synchronize against external database. But it is possible, the API is there and other customers have done it.
    I hope this clarifies things a bit.
    Jasmin

  • How to use more than one connection pool to 2 different databases ??? (Weblogic 5.1)

    Hello,
    In my application, I must use two different databases to retrieve
    informations...
    My application use EJB so I created two pool of connection named pool1 and
    pool2...
    But when I yet used the pool1 to connect to first database and I try to use
    the pool2 (to connect to the second database), an SQLException occurs :
    "java.sql.SQLException: Connection has already been created in this tx
    context for pool named <first pool's name>. Illegal attempt to create
    connection from another pool: <second pool's name>"
    I have found the answer in www.bea.com
    http://e-docs.bea.com/wls/docs61/faq/JTA.html#738373
    Anybody can help me and give me the more easy,quickly and the more efficient
    way to use two database with two different connection pool..
    Thanks..
    Dephi

    Hi
    You need to configure TxDataSource with XA connection pool.
    More information can be found here:
    http://e-docs.bea.com/wls/docs61/jta/thirdpartytx.html
    Regards,
    Slava Imeshev
    [email protected]
    "Philippe Da Cunha" <pdacunha@@webraska.com> wrote in message
    news:3bfcd6ee$[email protected]..
    Hello,
    In my application, I must use two different databases to retrieve
    informations...
    My application use EJB so I created two pool of connection named pool1 and
    pool2...
    But when I yet used the pool1 to connect to first database and I try touse
    the pool2 (to connect to the second database), an SQLException occurs :
    "java.sql.SQLException: Connection has already been created in this tx
    context for pool named <first pool's name>. Illegal attempt to create
    connection from another pool: <second pool's name>"
    I have found the answer in www.bea.com
    http://e-docs.bea.com/wls/docs61/faq/JTA.html#738373
    Anybody can help me and give me the more easy,quickly and the moreefficient
    way to use two database with two different connection pool..
    Thanks..
    Dephi

  • Run Labview as different windows user (for database connectivity)

    I have to connect to a corporate remote MSSQL-Database on the network, using the database connectivity toolkit for LabVIEW.
    The db-authentification is realized checking the windows user (ads) who acceses the datebase (not a database user / password which is standard in the database vis)
    Therefore I have to run LabVIEW as the defined windows user, different than the logged in user on the pc.
    Is that possible to realize with LabVIEW?
    Other Windows-tools allow to define the windows user/password which "run" an application - how can I do that with LabVIEW?

    Hi Zav.  There is a windows command 'runas' which _may_ let you do what you want; I haven't
    tried what you need to do, but is has worked for other tasks for us.  Try 'runas /?' for the switches.
    You will have to build your LV program into an executable, then use runas to launch it.  Is there
    a reason you can't just login to Windows as the required user?
    If you can get your db admin to allow dbuser/password authentication that would be a much better
    way to go.
    Matt

  • Database connection pooling in ADF causing db procedure calls to use different transaction or session

    We have developed an application using JDev Version 11.1.2.1.0 and the database is oracle 11g EE.
    We have many database procedures or function calls from the model (AMImpl.java, VORowImpl.java) and the commit does not happen in the database and it happens from ADF. The database procedures are called in some valueChangeListnener and these procedures use the same transaction or session database session when called and update some records in some tables that are displayed in pages.
    We started using connection pooling recently in our ADF application,  -Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1. When using connection pooling, we noticed that the database procedure calls use a different trasanction or different database session and the data or records that these procedures update is lost.
    After removing the connection pooling, we noticed that the procedures again started using the same transaction or same database session and was working fine.
    I want to know why this connnection pooling caused this issue and is there any fix for this when using connection pooling?

    Take a look at
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#CIHCHHEA
    What You May Need to Know About Database User State and jbo.doconnectionpooling = true
    As you can see:
    "At the end of the request when the application module is released back to the application module pool, that application module pool releases the JDBC connection it was using back to the database connection pool. It follows that with jbo.doconnectionpooling set to true the application module instance in the pool may have a completely different JDBC connection each time you check it out of the pool"
    So, the best you can do, is to revert jbo.doconnectionpooling to false.

  • Connecting to different databases

    Hi,
    Is there any one JDBC driver that connects to different databases (SQL Server, Oracle, Informix, MS Access, DB2..etc)
    Can anybody Pls help me for the above problem, its urgent

    There are some drivers, which supports several DBs
    look for them here:
    http://industry.java.sun.com/products/jdbc/drivers
    Paul

  • Connecting to two different database instances from a swing application.

    Hi All,
    I am developing a swing application which needs to interact with two different database instances of two different weblogic servers.
    More eloborately,
    I have some data in DB_Instance1 running on[b] Weblogic_Server1 and I need to insert the same data into DB_instance2 running on Weblogic_server2. Is it possible. Could some explain me how to do that..
    Thanks in advance...
    Sreekanth.

    Hi Rick,
    Try logging onto both Server first. You'll have to use either 2 separate ODBC DSN's or 2 separate OLE DB connections. Set them both for Trusted Authentication, you'll have to configure that on the Server also.Then try your query.
    If that doesn't work then you'll have to create a Stored Procedure or View that can link the 2 Server side.
    Thank you
    Don

Maybe you are looking for