skip to main content
Connection property descriptions : NewPassword
  

Try DataDirect Drivers Now

NewPassword

Purpose

Changes a user’s password when a connection is established. This property can be used to comply with corporate security policies that require a regularly occurring password change or to ensure access to the database if Oracle has let the user’s password expire. If specified and the connection fails, the password is unchanged.
This value is used only if user ID/password authentication is enabled explicitly (AuthenticationMethod=userIdPassword) or implicitly (AuthenticationMethod=auto and a user ID and password is supplied); otherwise, the driver throws an exception.

Valid values

string
where:
string
is a valid password.

Notes

*The current password also must be specified using the Password property. The driver allows you to use the same value for the current password and the new password, but be aware that your Oracle server security settings may not allow this use.
*The newPassword connection property is only supported when connecting to an Oracle server earlier than Oracle 12c. If the newPassword connection property is specified when attempting to connect to an Oracle 12c server, the driver throws a “No Matching Authentication Protocol” exception.
*For database versions prior to Oracle 12c, the NewPassword connection property is supported only when connecting to servers for which the ALLOWED_LOGON_VERSION parameter is either not specified or is specified with a value of 8. If the NewPassword connection property is specified when attempting to connect to an Oracle server for which the ALLOWED_LOGON_VERSION parameter is specified with a value greater than 8, the driver throws a "No Matching Authentication Protocol" exception.

Example

The following connection URL specifies the current password (secret1) using the Password connection option, and then specifies the new password (secret2) using the NewPassword connection option:
jdbc:datadirect:oracle://server1:1521;SID=ORCL;User=test;
Password=secret1;NewPassword=secret2
Similarly, the same connection information specified using a JDBC data source would look like this:
OracleDataSource mds = new OracleDataSource();
mds.setDescription("My OracleDataSource");
mds.setServerName("server1");
mds.setPortNumber(1521);
mds.setSID("ORCL");
mds.setUser("test");
mds.setPassword("secret1");
mds.setNewPassword=("secret2");
...

Data source method

setNewPassword

Default

None

Data type

String