Hi Derby Team,
I am using Apache Geronimo which uses embedded derby as the default database. Recently I tried to
enable authentication in derby by including a derby.properties file in with content as
Following this I had used system call's something as follows:
to provide secure access to database.
Till this everything works fine.
Next I utilize the NetworkServerControl api to start and stop a Network Server. A Network Server
is created as follows--> NetworkServerControl(address, port). Start is fine. However during network.shutdown()
I see the following exception:
java.sql.SQLException: Connection authentication failure occurred.
Reason: Invalid authentication..
This exception is legitimate since I do not provide any credentials to create a Network Server and this also
helps to prevent server shutdown from any unauthorised personnel. I am able to avoid this using the following
1) Add derby.user.test=test123 is derby.properties file.
2) create a Network Server Control object using NetworkServerControl(address, port,"test","test123");
However I am not happy with this kind of solution because of the following:
1) I had to set a system wide property that is "derby.user.test=test123".
2) The password appears in plain text.
3) I have to hard code the username/password while creating a NetworkServerControl object.
How can I avoid the above situation so that I
a) do not need to set password in plain text
b) do not need to set system wide properties
c) No hard coding username/password while creating a network server control object.