0

I am updating my db from a couple of threads and am not sure where exactly to close the connection from. I am using Java JDBC.

Thread t= new Thread(new Runnable() {
        @Override
        public void run() {
            SwitchHandler shandler = new  SwitchHandler (da);
            shandler.portOverSubscriber(routingWrapper);
            CloseConnection();
        }
    });t.start();
1
  • Why don't you make each thread open and close its own connection? Commented Jun 2, 2013 at 11:34

1 Answer 1

1

Instead of closing the connection try using a connection pool like DBCP

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.