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 192126 - Database password not stored correctly in data source
Summary: Database password not stored correctly in data source
Status: NEW
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 17:46 UTC by Petr Jiricka
Modified: 2016-03-28 04:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2010-11-18 17:46:28 UTC
1. Create a Java EE 5 webapp with WebLogic target
2. Create a persistence unit; as a part of the persistence unit create a new datasource (I used a Derby connection)
3. Deploy the application 

The data source will not be deployed correctly, because the generated setup/datasource-1-jdbc.xml file does not store the password correctly. Here is what was generated for me:
  ....
  <jdbc-driver-params>
    <url>jdbc:derby://localhost:1527/sample</url>
    <driver-name>org.apache.derby.jdbc.ClientDriver</driver-name>
    <properties>
      <property>
        <name>user</name>
        <value>app</value>
      </property>
      <property>
        <name>password</name>
        <value/>
      </property>
    </properties>
  </jdbc-driver-params>
  ...
Comment 1 Petr Hejl 2010-11-23 11:00:06 UTC
This works ok for me. Either the steps are different or some other part of the IDE (DatasourceUIHelper or DatasourceCustomizer) returns an empty password in certain conditions.

I checked the plugin code - I don't see any condition or different condition for password handling compared to other properties.
Comment 2 Petr Jiricka 2010-11-24 12:34:15 UTC
Now I know more precisely how to reproduce.

1. Create a Java EE web application, use any server that supports datasources
2. Make sure a db connection is registered in the DB explorer. In the properties of this connection, uncheck "Remember password"
3. Restart the IDE
4. Create a persistence unit; as a part of the persistence unit create a new
datasource using the connection mentioned in step 2.
5. Look at the generates server resource file

The password is written as empty - tested with both GlassFish and WebLogic.
Comment 3 Petr Hejl 2011-04-14 13:17:37 UTC
This is an issue in DatabaseConnection.restorePassword() it should set null for not-filled-in password instead of "".