Is it possible to let a user change their own password in Eclipse Persistence Services - 2.5.2.v20140319, Java 6u45 (also 7u72)?
When I run it I get
ORA-01935: missing user or role name
Password for user: XXXXXXXX was not changed. (i.e. at the time of the exception, username has the right value )
This JDBC code is being used via JPA 2.1 using:
jdbcConnection = entityManager.unwrap(java.sql.Connection.class);
public PreparedStatement changeDatabasePassword( java.sql.Connection jdbcConnection ) throws SQLException {
String alterUserSQL = "ALTER USER ? IDENTIFIED BY ? REPLACE ?";
PreparedStatement preparedStatement = null;;
preparedStatement = jdbcConnection.prepareStatement( alterUserSQL );
preparedStatement.setString( 1, this.username.getText() );
preparedStatement.setString( 2, new String( this.newPassword.getPassword() ) );
preparedStatement.setString( 3, new String( this.password.getPassword() ) );
return preparedStatement;
} // end method setStatusMessageText(