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.
I have this same error on 7.0.1 and 7.2 We have NetBeans RCP. We use Database Explorer and the ConnectionManager to connect to the database. The bug is really the exact same as the one referenced: 108422 Even if we keep the IDE session open, each time we press run, the application always asks for a password to make a database connection. This is despite the fact that the code I'm using to create that connection in the first place sets it to remember the password, exactly as described in this bug. Any help is really really really appreciated because I'm about to just throw the password into the user preferences as a work around which is completely insecure (I'm hoping the remembered one through your API is secure). John
Current DB code should be using the Keyring API to securely persist passwords.
I cannot reproduce on 7.2 (Windows 7), the remembered password is used as expected. Can you please attach some example code that demonstrates the problem? Thank you.
Closing. Please reopen if you can provide us with more information, preferably some example code.
Terribly sorry for the delay in responding to my own thread. To be clear - the issue is that the password is not remembered between application runs. Meaning, if I run the app, save password, close app, run app, then it asks for the password again. I'm assuming that remember password is supposed to span that. Is that correct? My code is literally: databaseConnection = SelectConnectionDialog.showDialog(); I have a singleton. When something wants a DatabaseConnection object, it calls out to the singleton. If the connection is null in the singleton, it creates a new one by calling: databaseConnection = SelectConnectionDialog.showDialog(); That call launches the DatabaseExplorer GUI that has an option "remember password". However, even if I check that, every time I run that app, it always requires the password. It will actually remember previous connections, and enable me to select from them, but for whatever reason, it will never remember the password. Am I missing something? I can try to include more code, but I don't think it's directly related.
Hey, I looked through the code which is responsible for saving a database connection. This code delegates to the keyring api to save the password: Starting point: /db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java (line 401, Method write) Leeds to: /db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java (line 622, Method storePassword) Leeds to: /keyring/src/org/netbeans/api/keyring/Keyring.java (line 184, Method save) Leeds to: /keyring/src/org/netbeans/api/keyring/Keyring.java (line 155, Method saveImpl) Leeds to: /keyring/src/org/netbeans/api/keyring/Keyring.java (line 96, Method provider) I think there is your problem - If no "real" keyring provider can be found, the "DummyKeyringProvider" (see line 217 in Keyring.java) is instanziated, which only works till the program is shut down (not persistency). So check whether you include a real keyring implementation into your application (see module keyring.impl ( Keyring Implementations ))
Thanks! That was it. I missed it as there is no dependency between DatabaseExplorer module and the keyring modules. Not sure if there should be such a dependency? I guess I'll set this to resolved and invalid. thanks, John