aspose file tools*
The moose likes JDBC and the fly likes Exclusive access could not be obtained because the database is in use. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exclusive access could not be obtained because the database is in use." Watch "Exclusive access could not be obtained because the database is in use." New topic
Author

Exclusive access could not be obtained because the database is in use.

mla mla
Greenhorn

Joined: Aug 19, 2004
Posts: 1
Hi all,
I have this err "Exclusive access could not be obtained because the database is in use". I disconnect the first connection and create another database connection but I have this error.

firstly what I disconnect is

static Connection con = null;
static Connection con1 = null;
if (con != null) {
con.close();
}
but I bitterly experiencd the error........
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

"mla mla",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Are you sure that you are closing all connections even in the event of exceptions in the rest of your code? Do others use the same database? It could be something as simple as that others have enough connections that the db's quota is full.

It's hard to tell for sure with the info you've given if your code is at fault or not.
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Which database are you using? What are you trying to do that requires exclusive access to the database? Are you changing configuration settings or something?

Jules
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exclusive access could not be obtained because the database is in use.