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.
- 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.
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?
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
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.
I'll try to reproduce this. Any chance this could be an enhancement to support connecting to external (to NetBeans) Derby instances ?
I'm not sure how it can be considered an enhancement when we already support talking to external Derby instances.
may not get to for 7.0, unless there's a strong need for fixing this.
Reassigned to new owner.