databaseconnection « Connection « Java Database Q&A





1. How to avoid accidentally closing an SQL Connection in Java?    stackoverflow.com

Currently what i am doing for transaction management is:

Connection connection = getConnection();
connection.setAutoCommit(false);
updateTableX ( connection, ... );
updateTableY ( connection, ... );
connection.commit();
closeConnection();
I would like to know, if it is possible to avoid closing ...

2. JDBC Connection closed by peer (weird)    stackoverflow.com

I'm facing sort of a strange issue with two applications of mine. Here's the setting: Two tomcat / java apps, running in the same network, connecting to the same MS-SQL-Server. The one app, which ...

3. Enumerate Open JDBC Connections?    stackoverflow.com

How do I enumerate/count all open JDBC connections? I've seen this thread, which doesn't answer my question. My interest is in writing test code in which the object being tested (call ...

4. Closing Database Connections in Java    stackoverflow.com

I am getting a little confused, I was reading the below from http://en.wikipedia.org/wiki/Java_Database_Connectivity

Connection conn = DriverManager.getConnection(
     "jdbc:somejdbcvendor:other data needed by some jdbc vendor",
  ...

5. DB connection from Sun webserver    stackoverflow.com

Hi whats the difference between the database connection made from a stand alone code and that made from a web application deployed in sun java web server. The code used ...

6. Ideally How many connections I have to open?    stackoverflow.com

Recently I attended interview in java, the interviewer asked a question like below: I have a request which go throgh A,B,C modules and response go back throgh A , in module A ...

7. What architecture to follow to connect to multiple databases    stackoverflow.com

Dear All, I'm building a core java application in which i have say 20 databases and want to connect to each of them depending upon from where request has come to ...

8. Should JDBC connection handles be per-app, per-thread, or per-query?    stackoverflow.com

Let's say we've got a web application or web service on an application server supporting JDBC connection pooling. Should I be grabbing a new Connection on a per-thread or per-query basis? Thanks!

9. DataNucleus / NeoDatis - DB connection appears to close causing Persistable objects to be lost    stackoverflow.com

Using DataNucleus I have a problem seen in the second INFO statement below (2nd entry from the bottom). When trying to read or edit an object after persisting it with makePersistent(), I ...





10. Connecting a Microsoft Access Database to Java using JDBC and compiling    stackoverflow.com

for a school database project we are making a database program (user GUI and the database). Using Microsoft Access 2010 I created the database and populated it with some sample data, ...

11. Will the sql connections automatically get closed if we close the JVM?    stackoverflow.com

I created a test program which creates 20 threads and then these threads will open many sql connection. Lets say you are executing this program from eclipse and now if you ...

12. Java - Memory Management / DB connections question    stackoverflow.com

I'm writing a DB connection pool in Java. It's just a class that holds a bunch of connections and gives them out. Do I need some kind of destructor method so ...

13. My persistence Unit is pinning to the fjords, when used for a remote connection    stackoverflow.com

While i does manage to connect to my database through the "Services" netbeans tab, my application persistent unit seems to not be working... It just seems to go in an endless ...

14. How to connect to pointbase database from javascript?    stackoverflow.com

I am working on a project in which I need to connect to pointbase database from javascript. I do not have much knowledge about java script. Is it possible to connect ...

15. JDBC Connection Link Failure - How to fail over?    stackoverflow.com

I have a stand-alone Java windows application developed based on Swing. It connects to a MySQL database for data storage. In case the database connection fails, I am getting a link ...

16. Reference two databases with Connection in java    stackoverflow.com

I have two local databases I'm trying to connect to using Java's Connection class. It's easy enough to connect to the first database using:

public Connection conn;
conn = DriverManager.getConnection(connectionString);
How can I ...





17. Is a finally block the correct location to close a database connection?    stackoverflow.com

Possible Duplicate:
Is java.sql.Connection thread safe?
I have gone through some tutorials.
They said to close the database connection through finally block.
But I have a question on ...

18. Database Connection Pooling (w/ Java)    stackoverflow.com

I would like to know your thoughts on whether this type of methodology could be practically implemented. I am very knew to database pooling, so forgive me for any misunderstandings. I ...