Connect to a different database at runtme???

I have 4 tables in a databese and I want to connect them and view them at runtime in a dbgrid, depending on wich table you choose to view in a combobox

You can pass table name as a parameter to the bean and that bean will return the rows pertaining to that table.
String query="select * from "+table_name;
ResultSet rs = st.executeQuery(query);
Sudha

Similar Messages

  • 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

  • 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

  • EM connecting to two different databases

    How do I connect to a second database?
    I can connect to the first database ...
    then I create a second database...
    but can't find the second database so
    I can administer it.

    You have to use the Grid Control to get connection to several databases from the same application. Although you can get connection to several databases separately with the database control.
    Joel Pérez

  • Connecting to two different databases on different machine ..is it Possibl?

    Hi EveryBody:
    In My application I'm pulling some files from one server to another server useing FTP and then inserting the file data in one Oracle database on UNIX Machine1 and at the same time updating another Oracle database table on another UNIX Machine2 ...Below I posted the method foe database connection, I also provided the code for calling that method twice it works fine for the first database and connect successfully but the second one it hangs ....I don't know why ...
    public void DB_connect(Database db,String dbip,String dbport,
              String dbsid,String dbuser, String dbpass){
    //Conecting to Database
    try{
    db=new Database(dbip,dbport,dbsid);
              db.connect(dbuser,dbpass);
              System.out.println("Connection to Database Successful");
    catch(Exception e){
    System.out.println("Error Connecting to Database.");
    //Calling the method in the main
    DB_connect(db1,db1ip,db1port,db1sid,db1user,db1pass);
    System.out.println("Successfully connected to the First DataBase ...");
    DB_connect(db2,db2ip,db2port,db2sid,db2user,db2pass);
    System.out.println("Successfully connected to Second DataBase ...");
    Thanks in Advance

    Can we display aprogress bar in
    the User Interface till we get the connection
    available ....Yes.
    How ??? You create a second thread that does something. When the connection is established (or fails) it sets a flag so the other thread knows it is time to terminate.
    Can u please provide code
    snippet That I can't do. There are probably plenty of examples in one of the forums that deal with GUIs (which this is not.)

  • One Report needs to connect to 20 different databases

    Post Author: macgary
    CA Forum: Data Connectivity and SQL
    We have 20 identical databases - structurally - but differing in their regional data.
    We have created some various reports that need to run against various databases in SQL Server.   I would like to avoid having to create 20 variations of each report varying only in their database connections.
    Does anyone have an idea of how I can pass the database name into the connection so I can make the one report work on any of my structurally similar databases?
    Thanks,
    Gary

    Post Author: Hieu
    CA Forum: Data Connectivity and SQL
    Select "Set Datasource Location" under the Database menu.

  • Problem connecting to two different databases from form

    Hi all,
    i am using 6i forms which needs to be connected to oracle 9i and 10g databases which is having different ip address(residing in different machines).i can connect to 10g database after configuring tnsnames.ora in my machine but still i cannot connect to 9i database. could anyone tell me what could be the reason.
    thanks
    mish

    Hi Paul.
    thanks for your help. i could able to solve the problem. since there was a change in the ip address (administrators do it sometimes!!) i couldn't connect. now its fine. thanks once again . have a great day.
    thanks
    mish

  • Connect to a different database

    Hi there,
    I have got a properly running HTML DB on a dedicated server and the database server is on another machine.
    And now I want to point this HTML DB installation to another database were HTML DB is also running properly . So I issued the command
    opmnctl stopall
    and then I did the modification within the tnsnames.ora for the alias HTMLDB.
    Then I issue
    opmnctl startall
    But the HTMLDB still connects to the old and not to new database that is referenced within the tnsnames.ora!
    So what am I doing wrong or is there another place where modifications have to be done?
    Thanks for help in advance!
    Regards,
    Christian

    Thanks for your reply, I have good idea about dblinks as i have been using dblinks with existing 8i and 9i servers. I have problem with 10g xe and application express.
    What i have made idea about these two until now is:-
    1. Oracle xe is a free database for developer and ISV's.
    2. Oracle application express is a tool for developing web based applications.
    3. Application express is installed and is configured with an existing installed 10g database.
    4. Free application express is also included with oracle express edition.
    5. Application express included with oracle xe is not fully featured. (like workspaces and options of new schemas).
    What i wanted to ask was, can i deploy web application with this free version of 10g i mean oracle ex ?, can i connect to other databases with the help of net service from this application express included with 10 ex.
    I am doing all this on my personal computer for testing the things (learning) not at the enterprise level, but my computer is part of network domain and i want to test all the features.
    Please help
    Regards

  • Connecting to a different database

    Hi,
          I need to retrieve the data from non-sap databse.Its an another ORACLE System.
    In our SAP also the back end is Oracle only.
    Now i need to retrieve all the data from a table  which was in another DB.How to connect that.
    Can anyone help me in this regards.

    You should check the ADBC classes available. (CL_SQL* classes)
    The program ADBC_DEMO should be of some help.
    BR,
    Suhas

  • CONNECTING FORM WITH TWO DIFFERENT DATABASES

    HELLO ALL
    Is there any way I can connect to 2 different databases at the same time. What I have is 2 different database for two different payroll systems. Now what I want to do is if user press a button I send some data from this payroll database to second payroll database using insert and update command.
    I am using Form 5, one database is Personal Oracle 7 and second is Oracle 7.3. (I don't think versions matters but anyway)
    Thanks
    null

    Hello,
    Yes u can connect to with several database at a time using ODBC connection and Exex_Sql package supplied with Forms6i as a built-in. There is no Exec_Sql built-in supplied with Forms5, but there is a library named exec_sql.pll (Check it out) supplied with Forms5.
    using this package u can connect with multiple DB at the same time.
    here is an example-
    Declare
    v_ConnHandle Exec_Sql.ConnType;
    v_CursHandle Exec_Sql.CursType;
    v_NumRows Pls_Integer;
    Begin
    v_ConnHandle := Exec_Sql.Open_Connection('Scott', 'Tiger', 'ODBC:DBName');
    v_CursHandle := Exec_Sql.Open_Cursor(v_ConnHandle);
    Exec_Sql.Parse(v_CursHandle,'Select ename From emp');
    Exec_Sql.Define_Column(v_ConnHandle, v_CursHandle, 1, v_EmpNAme);
    v_NumRows := Exec_Sql.Execute(v_ConnHandle, v_CursHandle);
    While Exec_Sql.Fetch_Rows(v_ConnHandle, v_CursHandle) > 0 Loop
    Exec_Sql.Column_Value(v_CursHandle, 1, v_EmpName);
    End Loop;
    Exec_Sql.Close_Cursor(v_ConnHandle, v_CursHandle);
    Exception
    When Exec_Sql.Package_Error Then
    If Exec_Sql.Is_Open(v_ConnHandle, v_CursHandle) Then
    Exec_Sql.Close_Cursor(v_ConnHandle, v_CursHandle);
    End If;
    Message('Error ('| |Exec_Sql.Last_Error_Code(v_ConnHandle)| |') : '| |Exec_Sql.Last_Error_Mesg(v_ConnHandle));
    End;
    hope this help you.
    best of luck.
    null

  • JDBC connection to two different machines from the same program

    I want to use JDBC to connect to two different databases that are on two different MySQL installations on two different machines.
    One of the installations is MySQL 4.1.12 and the other is 4.1.14-nt
    For some reason, all my statements seem to be going only to one machine, even though I am very clearly set it up to go to two different machines.
    Does anyone know whether connecting to two different installations from one program presents any unusual problems?
    Thanks.

    Unless there is some horrible defect in the MySQL JDBC driver (which I doubt!), there should be no problem and like the other poster says, please post snippits of your code so we can see what your doing...

  • Connecting to 2 different DB's on different servers

    I am trying to find out if it is possible to connect to 2 different databases on different servers so that I can use both DB's in the same query. If it is possible, how do you do it? Can you have 2 connections open at the same time for one object?

    Sorry. jverd. I was just trying to make sense from
    what the OP had posted. In the process, I might have
    said something stupid.
    jc4bud
    If they are on different servers, they are on
    different database instances. So you can never write a
    query like the one you wrote.
    It does not make sense in SQL either.
    You should get two seperate connections to both the
    databases, query data seperately and then try to do
    whatever you are doing.Basically get the data from both the databases in your servlet. Do your processing in the servlet to get the appropriate data. If they have to be on different Oracle DB instances, that is the only solution I can think of.
    If you can keep them in a single instance the story changes.
    You cannot have the same connection to two different
    database instances.

  • 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

  • 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

Maybe you are looking for