JDBC  - Connecting Multiple Databases

Hi JDBC's
I would like to know if it is possible to retrive a data from different tables and from different databases using a single query, which mean can I retrive data from multiple tables multiple databases in a single JDBC connection?
If not, How do I implement it?
Any Ideas or please point me to any related solution if you have.
Thanks.

Although theoretically possible in fact a single JDBC connection cannot work with several databases. To implement this feature somebody has to write another aggregating JDBC driver which parse SQL statement and work with other databases in background. I like this idea, but currently there is no such driver available.
Scriptella ETL (http://scriptella.javaforge.com) offers an interesting solutions for cross-database operations. See example on how -to copy a table from oracle to hsqldb: http://snippets.dzone.com/posts/show/3511
If you want to join 2 tables from different databases and copy the result to a third database use the following code:
<query connection-id="db1">
SELECT * FROM Table1
<query connection-id="db2">
SELECT * FROM Table2 WHERE Table2_ID=?Table1_ID
<script connection-id="db3">
INSERT INTO Table3 VALUES (?rownum, ?Table1_Field, ?Table2_Field);
</script>
</query>
</query>
Message was edited by:
ejboy

Similar Messages

  • Servlets/JDBC - Connect to database ONCE and not in every servlet - How?

    Hello, I'm using servlets and JDBC.
    In every servlet , i connect to the database and then i close the connection, but this is not ptactical.
    I would like to connect to the database once (at the beginning) when container starts and then close the connection.
    How am i supposed to do that?
    Thanks, in advance!

    Bad idea. Don't do that. The connection will timeout sooner or later (depends on DB used, it's usually around 30 mins) and your application will crash.
    You should always acquire and close the connection (and statement and resultset!) in the shortest possible scope. To improve connecting performance just use connection pooling.
    Create a DAO class which does all the task and just instantiate and assign it as Servlet class variable during Servlet's init() method. For more insights and code samples start here: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].
    To go back to your fundamental question, doing some stuff during startup and shutdown of webapp, you could use the ServletContextListener for this. But again, do NOT do this to get hold of an external resource such as a connection! It's receipt for trouble.

  • Problem in JDBC connection to database

    Hi,
    I m new to JDBC. I want to retrive some data from the database in my JSP page. How do i do it ??? I written a following code,
    String custid = null;
    String custname = null;
    String custref = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@<server>:1521:yoda","scott","tiger");
    Statement stmt = conn.createStatement();
    String strCustomer = "select customer_id from fmm_user_access where login_id = '" + username + "';";
    ResultSet rset = stmt.executeQuery(strCustomer);
    while (rset.next())
    custid = rset.getString(1);
    custref = "1."+custid;
    strCustomer = "select full_name from fmm_ofin_customers where customer_ref ='"+ custref + "'";
    ResultSet rset1 = stmt.executeQuery(strCustomer);
    while (rset1.next())
    custname = rset1.getString(1);
    conn.close();
    } //try
    catch (Exception e) {e.getMessage();}
    Are there any setup issues which i m missing, like setting some paths. Please advise.
    Thanks in advance
    Unmesh

    Hi Unmesh,
    I did not see any code in your JSP page which is printing the output of your query.
    You may want to modify your JSP to display the results like this
    <%@ page import="java.sql.*" %>
    <HTML><BODY>
    <%
    strCustomer = "select full_name from fmm_ofin_customers where customer_ref ='"+ custref + "'";
    ResultSet rset1 = stmt.executeQuery(strCustomer);
    while (rset1.next())
    custname = rset1.getString(1); %>
    Customer Name is <%=custname%>
    <BR>
    <% }
    conn.close();
    ........... %>
    </BODY></HTML>
    And you will need to ensure that the JDBC drivers( classes12.jar or ojdbc14.jar) are in your classpath.
    A couple of other observations I have about your code is
    1. You must explicitly close the ResultSet and Statement objects after you finish using them: rset.close();stmt.close()
    2. Try using PreparedStatements for your insert statements which allows you to define bind parameters. In your case -
    PreparedStatement pstmt =
    conn.prepareStatement ("select customer_id from fmm_user_access where login_id = ?");
    pstmt.setString (1, userName);
    You can refer to JDBC samples on OTN for more information : http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html
    Hope this helps.
    Sujatha.

  • How to connect multiple databases

    Hi all,
    This is my situation , i need to set the max number of connections to one database , if the connection exceeds then i need to connect to another database , is there any way to solve it? please help me

    Sounds like you want to write your own load balancer. Sweet!!
    As was already stated, this would be best handled by clustering your database servers.
    If it's not done at that level, what's the next best option? How are your users currently connecting to the database? Is it through a web server or from stand-alone clients? If it's a web server, the server should have some facility for creating datasources and pooling connections. If you are dead set on switching to a different database when the number of connections in the pool has been maxed out, then you might have to write your own singleton class to manage the connection pool(s).
    If your users are connecting through stand-alone clients, you have to force the client applications to connect through a single server that controls the connections.
    There's one major problem with switching databases...if a user saves some data there is no guarantee that they will connect to the same database when they want to read the data at some later point. Maybe if there is replication between the two databases in the cluster, they might be able to do that.
    Edited by: user9221846 on Feb 11, 2011 8:04 AM
    Edited by: user9221846 on Feb 11, 2011 8:05 AM

  • Primavera with Oracel 11g standard edition ( Connecting multiple databases)

    I have installed primavera 8.2 with Oracle 11g standard edition. ( After lots of trial and errors )
    I installed / Created two databases using primavera dbsetup.bat file for creating new database.
    Data base names are PMDB and PMDB2
    Currently i am using PMDB with oracle connection string as "ORCL" and database aliase as PMDB and its working fine
    "C:\app\xxxxx\oradata\orcl" this location contains both databases physically
    I seek your advice how to modify string to access other database ( PMDB1)
    because if i have tried with different aliase name but it connect to same database ie PMDB

    Is this P6 EPPM 8.2 or P6 PPM? Are you using P6 client or web to connect to it?
    If this is P6EPPM then you can log into P6 Administrator and expand database node, create a duplicate node of it and change the database connection parameters. Save it and try to login using P6 Web. Select the correct database from Advance link below Username/Password.
    If this is P6 PPM then define tns entries on your machine for both the databases ans use them to configure P6 client.
    Sachin Gupta

  • To connect multiple databases..

    in my model
    C1 -- interface -- S1 -- interface -- DAS1 -- DB1
    -- DB2
    -- DB3
    i established connection between c1 and DB1..
    now im retrieving a field from DB1 and i with that field i want to search in other databases DB2 and DB3 and put all the tuples from DB1, DB2, DB3 as a single tuple.... i dunno how to model this, currently i go this field extracted from DB1 in DAS1 and how can i connect to DB2?
    Do i need to place S2 -- DAS2 -- DB2 and pass back the data to S1 then to S2 ?? are is there any simple method to do it???
    regards...
    kams....

    i established connection between c1 and DB1..
    now im retrieving a field from DB1 and i with that
    field i want to search in other databases DB2 and DB3
    and put all the tuples from DB1, DB2, DB3 as a single
    tuple.... i dunno how to model this, currently i
    go this field extracted from DB1 in DAS1 and how can
    i connect to DB2?
    With another connection, statement, etc.
    Do i need to place S2 -- DAS2 -- DB2 and pass back
    the data to S1 then to S2 ?? are is there any simple
    method to do it???As above.
    Alternatively you set it up so the database does this for you using a remote view. Probably easier to code, probably no more efficient particular if you are using different database vendors. And it might not be possible.

  • Create connection multiple database server connection with sinle client

    My problem is like this. I have 3 database servers like server A,server B,Server C. First Client will communicate with server A and Server B at the same time. Then if the connection is done then i need communicate with server C. Is there anybody who has the sample code for this. Please help me i am facing problems with this.

    I want to build a web site using jsp servlet for my university course purpose. In the background i will have three servers one is database server like server A another is certificate authority server like server B and the other one is Bank server like server C. Next, user will input through login page(say for example user name & password for database server A, certificate credentials for server B) then the login page will check user credentials kept in server A and at the same time with server B(CA server). If the user credentials kept in both of these servers(A &B) are matched then the page will inform that this is the valid user and connect to the bank server for money transaction. I hope now the my problem is clear to you. please answer me how can i prepare for that.
    what are the concepts related to that and have any demo code which i can use for that purpose.

  • How to connect multiple database in a single app?

    hi ppl,
    Im being asked to provide a application which is database independent.
    I need ur ways to approach this issue.
    if u have a solution, do drop in here.
    Thanks & Regards,
    intelnbril

    on the paper, the hibernate persistence framework can achieve that.
    In the reality its a bit more complicated as your app becomes more complex.
    anyway i'd say it is the best solution

  • Error in obtaining JDBC connection JBoss Seam 2.0.2 11g

    Hi,
    We are running a J2EE application based on JBoss Seam 2.0.2 and 11g R1.
    We are frequently encountering the below error. It is very intermittent and goes away on a screen refresh.
    Some help in resolving this would be greatly appreciated -
    java.lang.RuntimeException: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of oracle.jdbc.driver.OraclePreparedStatementWrapper - oracle.jdbc.driver.OraclePreparedStatementWrapper
    at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:152)
    at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(StatefulContainer.java:409)
    at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBeanContext.java:388)
    at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:316)
    at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:387)
    at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
    at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:97)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
    at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
    at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
    at $Proxy354.destroy(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
    at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
    at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
    at org.javassist.tmp.java.lang.Object_$$_javassist_6.destroy(Object_$$_javassist_6.java)
    Caused by: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of oracle.jdbc.driver.OraclePreparedStatementWrapper - oracle.jdbc.driver.OraclePreparedStatementWrapper
    at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:822)
    at org.jboss.ejb3.stateful.StatefulBeanContext.getInterceptorInstances(StatefulBeanContext.java:781)
    at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.getLifecycleInvocationContext(LifecycleInvocationContextImpl.java:65)
    at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:143)
    ... 57 more
    Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of oracle.jdbc.driver.OraclePreparedStatementWrapper - oracle.jdbc.driver.OraclePreparedStatementWrapper
    at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342)
    at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
    at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
    at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
    at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
    at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
    at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
    at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
    at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
    at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
    at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
    at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
    at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:793)
    ... 60 more
    Caused by: java.lang.InstantiationException: oracle.jdbc.driver.OraclePreparedStatementWrapper
    at java.lang.Class.newInstance0(Class.java:340)
    at java.lang.Class.newInstance(Class.java:308)
    at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334)
    ... 85 more
    Thanks !!
    Shankar

    I agree with the previous post.
    Here are some of my previous posts that might help. As a general rule, an a MVC design, your JDBC objects (connection, resultSet, preparedStatement) should not be exposed outside of the database layer.
    Re: how to connect multiple databases
    Re: can not get the right query result using JDBC

  • How to add multiple databases for a single frontend

    We have a project based on distributed databases and we have to workout on .Net framework.I want to know some information of connecting multiple databases for a single frontend and how can we access them.
    If so we have connected 2 databases for a single frontend in future if I want add one more database to it how it will be possible to do it without disturbing the current connectivity.
    Please help me in resolving this problem.
    Thanks......

    hi,
    what do you mean by connecting 2 databases? can you explain further?
    using entityframework you can connect to different databases
    public class CustomerContext : DbContext
    public ReportContext()
    : base("DefaultConnection")
    public DbSet<Customers> Customers { get; set; }
    and your connectionstring (config file)
    <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\\Database\Project.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    you can add more connection strings on it.
    https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.100).aspx
    https://msdn.microsoft.com/en-us/library/ms254978(v=vs.110).aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • JDBC Connection for Oracle

    Hello Experts,
    I'm having some trouble getting a JDBC connection to work correctly and I am in need of some advice.
    Background:
    I have setup a test Portal 7.00 SP14 with an Oracle 10.2.0.2.0 database on a Windows 2003 X64 server.  The Portal system was up and running and connecting to a WAS6.20 systems.  We do not have BI or XI in our landscape.
    I needed to connect to an Oracle 10.2.0.3.0 database from visual composer to read some data from tables to do a proof of concept. From what I understand this connection will be a JDBC connection.  I have setup a new system using the JDBC template, assisnged an alias, and entered the connection URL .  I was unable to connect. 
    I read that I need to add the driver using Visual Composer.  I did so with the following instructions:
    Install JDBC Driver
    • Start the Visual Administrator
    • Logon at WebAS
    • Open: Server, Services, JDBC Connector, Drivers
    • Choose “Create New Driver or DataSource” on the toolbar
    • Specify an arbitrary name for your driver entry such as “OracleDriver” and click OK
    • Now search for the Oracle JDBC Driver JAR file on your local harddisk.
    I restarted the Java instance with SMICM after completing this task Java will not start.  Is there anyway to roll back that change to get Java back up and running? 
    Also is there a better way to go about making this oracle connection?
    Best Regards,
    Edited by: Troy Loseke on Feb 20, 2008 8:30 AM

    Hi,
    although [this guide|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/92d80512-0a01-0010-32a3-cd3735bd9275] is for Visual Composer I find it very helpful in setting up JDBC connections to databases. There is a very deltailed section about setting up a system to a MS SQL Server and the relevant data if you want to connect to Oracle:
    4.2 BI JDBC Connector to Oracle
    Located at:
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    Driver: oracle.jdbc.driver.OracleDriver
    URL: jdbc:oracle:<drivertype>:@<database>
    jdbc:oracle:thin:@myhost:1521:orcl
    Hope this helps,
    Holger.

  • Using JDBC to connect all database

    i want to create a DB layer through which i should be able to connect to the database specified at run time.how do i understand for databases like Mysql which OS-specific Driver to load at runtime.i want to make the Db layer platform independant and it should be able to talk to multiple databases.Is there a way to know at run time which drivers are available in the system.

    i want to create a DB layer through which i should be
    able to connect to the database specified at run
    time.Fine. JDBC, reflection and some configuration settings should get you most of the way there.
    how do i understand for databases like Mysql
    which OS-specific Driver to load at runtime.Each RDBMS you want to support will have to have its driver available for use in the CLASSPATH.
    i want
    to make the Db layer platform independant and it
    should be able to talk to multiple databases.Is there
    a way to know at run time which drivers are available
    in the system.That will be problematic. Not all RDBMS vendors are even totally ANSI SQL compliant. DDL is normally highly vendor specific, as are triggers, stored procedures, views. et. al. So, I would forewarn you that this will be a difficult task. Are you really sure that your requirements are valid?
    - Saish

  • Servlets and multiple JDBC connections...

    Hi Guru's
    I want to perform multiple JDBC queries simultaneously from my servlet. Let's say I have a connection pool containing JDBC connections. Now what I want to do is to use each of this connections simultaneously to perform queries in parallel.
    What is the best way to do this??? create multiple threads, one for each query, and then collate results when all threads are finished???
    Has anyone does this before or know of any links or samples which I can look at??
    your help much appreciated...
    Many Thanks

    Thanks but further questions....
    But take care:
    multithreading might only work parallel if there are
    multiple processors - otherwise the thread fragments
    will be processed one after the other until they are
    finished.I agree. My server has multiple processors hence multi-threading.
    Why do you need to perform the queries
    simultaneously?
    wouldn't it work too when you perform the queries one
    after the other?To speed up performance. Sequential processing is too slow at the moment.
    Hope you don't try doing so inside one single
    database...yes inside a single databse.
    Do you have any links to sample example etc..??? Importantly are you aware of any issues when one does this type of multi-threading from servlet. i.e does it clash with servlet's threading model etc...
    I am aware of how servlets multithread requests and am quite familiar with them. Just wanted some examples on multithreading JDBC connections from servlets and how I can wait for all threads to finish before collecting results....also wanted to make sure that there are no other issues....
    further help will be much appreciated.....

  • Multiple JDBC connection pools

    Hi
    I have WLI application ( 7.0 ) and another J2EE appliction configured on WLS (
    7.0 ). If I have multiple jdbc connection pools configured to access different
    ( or even the same ) databases, I am unable to get the connection to execute a
    sql query in the J2EE app. The connection pool gets initialized properly during
    the server startup and I can see them in the console but when I try to acquire
    a connection from the pool for execution of a jdbc stmt, I am unable to obtain
    a connection. Did any one succeed in configuring mulitple jdbc connection pools
    and WLI and another J2EE app to run together on WLS 7.0? Any suggestions are welcome.
    Thanks
    Sreeram

    Well ... It boiled down to ACLs.
    "Sreeram" <[email protected]> wrote:
    >
    Hi
    I have WLI application ( 7.0 ) and another J2EE appliction configured
    on WLS (
    7.0 ). If I have multiple jdbc connection pools configured to access
    different
    ( or even the same ) databases, I am unable to get the connection to
    execute a
    sql query in the J2EE app. The connection pool gets initialized properly
    during
    the server startup and I can see them in the console but when I try to
    acquire
    a connection from the pool for execution of a jdbc stmt, I am unable
    to obtain
    a connection. Did any one succeed in configuring mulitple jdbc connection
    pools
    and WLI and another J2EE app to run together on WLS 7.0? Any suggestions
    are welcome.
    Thanks
    Sreeram

  • Best way to connect java app to multiple databases?

    I'm working on my first commercial application, and I want it to be as flexible as possible, meaning I want it to be able to connect to a wide range of databases, as the customer chooses. I'm wondering what the best way is to accomplish this, I don't really want to have to buy a commercial license for third party ODBC drivers, any one have some good comments on this?

    You have two fundamental options:
    Use an O/R mapping tool like: Hibernate, EJB BMP, JDO, etc.
    Develop your own using JDBCIf you opt for the former, you should ask youself, "What value do i add? Or should I simply use these technologies?" The advantages are that dozens of other developers, going down similar routes, have faced the obstracles you will face and more. The disadvantage is that none of these developers has actually faced your specific problem. This is not to say that the solution does not already exist. The efficacy of this methodology will be how closely the general solution fits with your own (and since many problems have the same challenges, this will often be true).
    If you opt for the latter, you will have both an opportunity and a pitfall. The precise, business issue your current project addresses has many things both in common with other projects and also a handful of unique challenges. The hard part is determining whether this challenge actually differs in some fundamental way, or whether you have discerned some fault or opportunity in your methodology compared to standard (or even cutting-edge) practices.
    In reality, the challenge of "connecting to numerous, heterogenous (and probably vaprous) database systems" has long been addressed. Addressed, but perhaps not solved. If your goal is to develop a class library, for personal or consulting use, or to increase your understanding of the O/R boundary and best practices to obviate it, then my best advice is to read existing literature, and give it your all. There is no right answer here, and building on an existing experience of failure and success is indispensible.
    If your aim is to solve the O/R mapping challenge, or to suppant JDBC BMP, Hibernate or JDO, then my hat is off to you. We are all eagerly awaiting that day. (Sadly, after much effort, it has not yet arrived).
    So, can you connect Java to multiple databases, and even a diverse array of RDBMS vendors? Of course! But what will you do with those conections?
    - Saish

Maybe you are looking for

  • Problem in JAXB

    Hi. Can we have an XSD file with only some tag elements from the XML file. I am having an XML file of around 250+ (distinct)tag elements. Can we have a XSD file with few elements entered and some extra tags present in XML file.

  • Fireworks CS6 trial is very slow on Windows 7

    I'm not sure what's going on, but it's bound to be fixable. I've downloaded and installed the Fireworks CS6 trial and it's stalling after performing simple tasks. The only way I know to describe it is like this -- here are a few examples: Try to crea

  • Image preload issue

    I've built a flash site for a video company. Due to the design and fact they want high quality videos on the site, the final file is a monstrous 9 megs! I've built a preloader into the site which seems to work fine, except for one issue. I built a 3D

  • Utilities Programs?

    What are some system utilities programs that users have found helpful -for cleaning, permissions repair, etc.?

  • Clone stamp tool disables keyboard

    I'm working on an iMac, OSX (10.7.4) with CS5.1. Ever since I uploaded my new Photoshop program months ago, it disables the alphanumeric keys on my key pad when I use the clone stamp tool. I have to restart my computer in order for my keyboard to wor