Multiple connection « Connection « Java Database Q&A





1. Can JDBC connection strings specify multiple databases?    stackoverflow.com

Here's my current connection string:

jdbc:amazon;moduleName=Foobar:oracle:thin:@ab1na-orasvr.db.foobar.com:42111:ab1na
But I need JDBC to access multiple databases. Can I simply append the second module name, separated by a semi-colon?

2. Java Database Connection Pool for multiple databases (Shards)    stackoverflow.com

I was wondering what the best technique for implementing a DB connection pool for a web application which uses shards. From what I can tell most (all?) open-source implementations only support ...

3. committing multiple connections during a transaction    stackoverflow.com

can i create multiple connections during one transaction and perform commit on them provided the connection are taken from data source in weblogic. ??? please help

4. How to share database connection pool across multiple JVM?    coderanch.com

RMI would work I suppose, but thats a lot of effort to just have them all share a DB connection pool. Couple of questions first before I can say if RMI would be worth it. Are all of your programs independant of each other(you start them all with their own JVM)? Or can you meld them all together into a single ...

5. JDBC and multiple DB connections    coderanch.com

Hello, I'm trying to pull info from 3 DB2 databases and send to one Oracle 8.1.6 database. While I can connect to each individually, finding a way to put them all together seems a bit daunting. Would the 3 DB2 databases cause some type of lock up? How would I get them to do a "Round Robin" and pull from one ...

6. handling multiple queries with the same connection    coderanch.com

algorithm: connect query the table for the username if username does not exist write to the database //connect to the database using Connection con = .... String user; //set the user string to username to be checked PreparedStatement ps=null; ResultSet rs=null; ps = con.prepareStatement("SELECT username FROM table1 where username = ?)"); ps.setString(1, user); rs = ps.executeQuery(); if (!rs.next()) { //no match ...

7. single jdbc connection spanning multiple http requests    coderanch.com

Yes you can, but it is not normally done, because the transaction can be very long (in fact the user may abandon it halfway, in which case you'll probably have to wait for session timeout). You will be holding on to record locks and other database resources which doesn't bode well for scalability. The usual fix is either to gather all ...

8. Multiple statements on single connection?    coderanch.com

Statements are executed on the server in the order they were executed on the client. You can batch up statements to ship them as a block. That cuts down on network traffic, but they still have a defined order. If you literally want simultaneous independent statement execution then you want multiple connection objects, typically managed via a connection pool. Note: Oracle ...

9. Multiple RDBMS Connections    coderanch.com

hi, I need to connect to two different RDBMS lets say DB2 and Oracle. Can I use Class.forName("mydriver") technique to load the database drivers and get connection using DriverManager.getConnection(). I think its not possible. How can I make my Swing ( desktop ) application to connect to different RDBMS, using the same JVM. Thanks for the time.





10. multiple data base connections best practices    coderanch.com

How do you mean, check to see if they're available? Do these databases get turned off occassionally? You could attempt to connect to one, and if that connection fails, attempt to connect to the other. More likely, however, is that you want to store the connection information in some .properties file and have the user select which connection they want to ...

11. Using one connection object between multiple threads    coderanch.com

Only if the pool contained enough connections for each of my threads. My threads are not going to be 'returning' the connection to the pool at the end of each 'processing cycle'. They each have several different statements (not just the one i mentioned above). The pool paradigm suggests that the object using the connection should return it to the pool ...

12. Multiple database & multiple connection problem.    coderanch.com

Dear All! Wht should i ve 2 do DBConnection class if i ve multiple databases. like i ve 1. dbAccount04 2. dbSale04 3. dbPurchase04 While working in dbAccounts i also have 2 get result from dbSale and dbPurchase in single form. plz be informed that these 3 database are changed yearly as u can c "04" at last. Plz guide me. ...

13. multiple inserts with multiple connections into same db table.    coderanch.com

Hi Guys, I hope someone can help I have two or more threads which are inserting into the same target database table, each having their own connection. The connection has autoCommit set to false and I am performing batch inserts (batch size 10) and am only commiting once all inserts have been performed per thread. My problem is that I am ...

14. Multiple preparedStatements 1 Connection    coderanch.com

I'm not to sure if I'm doing this correctly, well as a matter of fact I'd say I'm not as the Update although not returning an error is not updating the second statement ps2. The ps statement executes OK its the second one that won't execute. What I'm doing is pulling data writing to a file to ftp across the ether, ...

16. JDBC Connections Freezing with Multiple Users Accessing DB    coderanch.com

I wrote a fairly basic SQL database-driven Java application that tracks misc. data about different people/businesses. It seems to work OK when there is only one user using the software, but when multiple users are trying to access data the application will freeze. No errors are generated, but the application usually has to be manually killed. Specifically, the user will enter ...





17. Connection pool with multiple users    coderanch.com

Swathi, Any reason not to create a different datasource for the users if there is a small number of users? If there is a lot of users, you could create another id to access the database on their behalf. I don't know what happens in your scenario as I've never had cause to do this. You could see if your datasource ...

18. Multiple prepareStatement on one Connection    coderanch.com

Hi, how does multiple prepared statment work on one connection object. Unknowingly I was using it for a while and it does work. Now while reviewing my code i was wondering how does this actually work. Here is the code sample: Connection box1Con = Commons.getBOX1DBConnection(); Connection box2Con = Commons.getBOX2DBConnection(); queryResource = readResource(); PrepareStatement ps1 = box1Con.prepareStatement(query1); PrepareStatement ps1 = box2Con.prepareStatement(query2); Thanks ...

22. Making a connection between multiple databases    dbforums.com

I'm using JAVA DB (derby) I want to import a public view of my data to another database (also in java db). I want to pass this data and save in to the other database. I'm having trouble since the general rule is one connection to one database. Help would be much appreciated.

23. Making a connection between multiple databases    java-forums.org

I'm using JAVA DB (derby) I want to import a public view of my data to another database (also in java db). I want to pass this data and save in to the other database. I'm having trouble since the general rule is one connection to one database. Help would be much appreciated.

24. create connection multiple database server connection with sinle client    forums.oracle.com

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. ...

25. Multiple connection of same database    forums.oracle.com