This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 82188 - createDatabase could check for existance of database first
Summary: createDatabase could check for existance of database first
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-08 18:01 UTC by John Baker
Modified: 2008-11-10 12:13 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2006-08-08 18:01:03 UTC
createDatabase(...) methods do not check for the existance of a database
before trying to create.  As a result an odd exception occurs - "invalid userid" 

Request is to make sure the database doesn't exist before creating it.
If a database exists then post information dialog
Comment 1 John Baker 2006-08-08 18:26:08 UTC
Posting an information dialog is not required. As long as database creation
doesn't proceed if the database exists and the result is handled gracefully.
I prefer not to see an exception thrown.  
Comment 2 Andrei Badea 2006-08-08 18:47:39 UTC
Not sure, I would on the opposite prefer to see a DatabaseException thrown,
otherwise the method semantics gets too complicated. You must handle
DatabaseException's anyway, so I guess it doesn't make calling the method harder.

Do you need this fixed for 5.5?
Comment 3 John Baker 2006-08-08 20:00:05 UTC
That's fine, the exception can be handled.
Since there's a method databaseExists, this request is not needed for 5.5
Comment 4 Roman Mostyka 2008-11-10 12:10:04 UTC
Now if user enter name of existing DB, button "OK" becomes disabled and it isn't possible to create double DB.
Fixed.
Comment 5 Roman Mostyka 2008-11-10 12:13:00 UTC
v