ODP.NET OpenWithNewPassword

Oracle allows users' password to expire. ODP.NET lets applications handle the password expiration by providing a new method, OpenWithNewPassword, that opens the connection with a new password.
The following code snippet uses the OracleConnection OpenWithNewPassword method to connect with a new password of panther:
// C#
...
OracleConnection con = new OracleConnection();
con.ConnectionString = "User Id=scott;Password=tiger;Data Source=oracle;";
// Here the con.Open() fails if the password has expired.
// An application catches this and attempts to reconnect with a new password
// of "panther". The initial connection string must remain intact.

try {
con.Open();
}
catch {
con.OpenWithNewPassword("panther");
}



dotnetraj at 12:27:44 pm on 3/16/2005



Leave a Comment:

Name


Homepage (optional)


Comments





Previous Entry Home Next Entry


<< March 2005 >>
Sun Mon Tue Wed Thu Fri Sat
 01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31


Contact Me

If you want to be updated on this weblog Enter your email here:
 

Blogdrive