This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes DB Connection Exception in Multithreaded code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DB Connection Exception in Multithreaded code" Watch "DB Connection Exception in Multithreaded code" New topic
Author

DB Connection Exception in Multithreaded code

Roshini Sridharan
Ranch Hand

Joined: Jan 16, 2001
Posts: 143
Hi,

There's a multithreaded code that creates N no. of threads, each thread creates a new DB Connection instance to connect to a DB using JDBC. So there are N no. of individual connections to the database created by each thread. In this context find that when one of thread is being created and it tries to get the DB Connection the below Exception is being throwed.

As per the exception, find its relevant to the JDBC URL formation. Please note the method that obtains the DB Connection is a synchronized one.



Would like to know the possible cause for this and the possble solution like implementing colleection pooling would help.

Thanks in advance.

Regards
Roshini
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
Reasons for "invalid arguments in call" usually are around invalid
configuration (URL, user/pwd).
Roshini Sridharan
Ranch Hand

Joined: Jan 16, 2001
Posts: 143
Hi,

Can someone provide me some insight into this issue.

Thanks.
 
wood burning stoves
 
subject: DB Connection Exception in Multithreaded code
 
Similar Threads
java.sql.SQLException: Io exception: The Network Adapter could not establish the conn
Connect to Oracle via JDBC using JSP..
JDBC- ORACLE
oracle DB not connecting
JDBC- ORACLE