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 108476

Summary: Can't use Create Database dialog in a directory where server authentication is enabled
Product: db Reporter: David Vancouvering <davidvc>
Component: DerbyAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: blocker CC: abadea
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description David Vancouvering 2007-06-29 00:07:57 UTC
- Create a directory for databases
- Create a derby.properties file in this directory so that authentication is enabled:
derby.authentication.provider=BUILTIN
derby.user.davidvc=davidvc
derby.connection.requireAuthentication=true

- Start the Java DB network server *outside* of NetBeans.  Set derby.system.home to point to your database directory

java -cp "derby.jar:derbynet.jar" -Dderby.system.home=/Users/David/code/db org.apache.derby.drda.NetworkServerControl start

- Stop the server

- Start NetBeans

- Tools->Java DB->Create Database

- Use the same database location, user and password as you set up externally

- Attempt to create the database

- You get the error:

An error occurred while creating the database:Connection authorization failure occurred.  Reason:userid invalid

It doesn't matter what database name you use, or whether the server is running or not outside of NB, you get the same
error.  Note the server starts up fine, and a connection is established, but authentication fails.
Comment 1 Andrei Badea 2007-06-29 16:04:27 UTC
Caused by the server authentication. The database is created by connecting to the server with a create=true parameter,
which fails because it doesn't specify an user name and password.

Simplest would be to require the user to enter an user name and password when creating a database on a server with
authentication enabled. But this would also enable the authentication for the database, which doesn't probably make much
sense.

So the alternative could be to require the user to enter an user name and password which can be used to connect to
server to create databases. The user would do so in the Settings dialog. These credentials would be always used to
create new databases, but wouldn't necessarily set up authentication for those databases. Note that in order to shut
down the server it is necessary to connect to it too, so the credentials be useful there too.

Opinions?
Comment 2 David Vancouvering 2008-01-10 00:47:11 UTC
abadea: can you explain what you mean by "But this would also enable the authentication for the database, which doesn't
probably make much sense"?  Why does requiring a user and password enable authentication?

Thanks,

David
Comment 3 Andrei Badea 2008-01-10 14:45:45 UTC
Hmm, I'm not sure what I meant by that. Perhaps just that if you enter an user name and password (and pass them on when
creating the database) you solve the issue, but at the same time (in the current implementation) you get a database
which has been set up to use authentication with that user name and password.
Comment 4 John Baker 2008-09-09 07:21:17 UTC
I'll try to reproduce this.

Any chance this could be an enhancement to support connecting to external (to NetBeans) Derby instances ?
Comment 5 David Vancouvering 2008-09-09 17:34:11 UTC
I'm not sure how it can be considered an enhancement when we already support talking to external Derby instances.
Comment 6 John Baker 2008-11-18 17:06:27 UTC
may not get to for 7.0, unless there's a strong need for fixing this.
Comment 7 Jiri Rechtacek 2009-02-10 15:38:11 UTC
Reassigned to new owner.
Comment 8 Jiri Rechtacek 2009-10-16 14:14:30 UTC
Reassigned to new owner.