aspose file tools*
The moose likes JDBC and the fly likes drop database with PreparedStatement  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "drop database with PreparedStatement  " Watch "drop database with PreparedStatement  " New topic
Author

drop database with PreparedStatement

yaron re
Greenhorn

Joined: Jun 29, 2007
Posts: 7
any idead why the following code doesn't work:

con = dataSource.getConnection();
ps = con.prepareStatement("DROP DATABASE DBNAME ");
rs = ps.executeQuery();
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8

Maybe because your code has an active connection to the database?
What happens when you execute the code? (better not try this on your production instance)


OCUP UML fundamental and ITIL foundation
youtube channel
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Why do you think that its appropriate here in performance?
yaron re
Greenhorn

Joined: Jun 29, 2007
Posts: 7
the dataSource is in a superior level to the instance that i am tring to delete.
The connection must have the ability to delete the DB.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
The question remains the same. What are you getting? Any errors? Excpetions? Messages?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: drop database with PreparedStatement