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 drop database with PreparedStatement  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 "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: 2491
    
    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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drop database with PreparedStatement
 
Similar Threads
Game on SQL
Restore problem
WA #1.....word association
How to prevent a user from dropping tables
Clean database