Resetting expired password from JDBC

Hi All,
I would like to know if it is possible to change an expired password from a java client that uses JDBC (classes12.zip) "thin client" to connect to oracle database (8.1.7.4).
Can we capture the "password expired" exception from the client and change the expired password from within the java client.
The current connect string is --->
Connection conn;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:@host:port:sid",user,pass);
Is it possible to do something like this ???
try {
conn = DriverManager.getConnection("jdbc:oracle:thin:@host:port:sid",user,pass);
catch ( SQLException sqle ) {
if ( sqle.getErrorCode() == 28001 ) // i.e. passwd expired
//1. ask user to enter the new passwd &
//2. change it in the database.
Is there any other way of doing this ??
Thanks in advance
Arun

I haven't tried this, but there some things to think about.
1) Have you tried to capture the Exception? Is it a problem?
2) Have you tried to alter a password through JDBC? Is it a problem? To execute other DDL you have to use executeUpdate() I would assum that if you can do this it will also require an executeUpdate().
Now assuming #1 and #2 are OK
3) How are you going to change a password when the you cannot connect because the password has expired? Are you going to hard code another non-expired userid/password in the code (bad idea). Are you going to ask the user to enter some type of administrative userid/password that will allow them to change their password?
Just some thoughts, sorry I cannot help more...

Similar Messages

  • Reset expired Passwords?

    Recently the DBAs overhauled out account policies to have passwords expire every X days. I'm running into my first expired account and I'm getting an ORA-28001: the password has expired error, but no prompt to reset the password.
    I thought I'd put in a feature request for a password reset window for this situation, but it seems that there was already one out there: http://htmldb.oracle.com/pls/otn/f?p=42626:39:2786248920877118::NO::P39_ID:22121
    Closed: "Context menu to Reset Password is available"
    Does anybody know how to go about resetting expired passwords in SQL Developer?

    So my help-desk finally got around to doing an install of the 11g client. Still having an issue. I've done the following:
    -Made my ORACLE_HOME the 11g client base dir.
    -Made %ORACLE_HOME%\bin the first entry in my path
    Still getting the same error. Even tried creating a new connection. I can connect with 11g SqlPlus.
    Any thoughts?

  • Resetting admin password from non-original CD

    We have a 400 Mhz Powerbook G3 running Mac OS X 10.3.3. We got it from eBay as is––no CD's, no other information. Now that I have inadvertently locked System Preferences, that is a problem because we do not know the admin password.
    I see that you can reset the password by booting up from a Mac OS install disc. My question is, would it be possible to do that using the OS X install disc for v. 10.3.7 that came with my iBook G4?

    Usually the OEM install disc that comes with a particular computer model will not work with other models. However, you can give it a try. If you can get it to boot the Powerbook, then after the installer loads select Reset Admin Password from the File menu.

  • Resetting previous password from database?

    Hi!
    I've lost my laptop a few days ago.
    Then one of my friends messaged me that someone contacted him from my skype account, looking for the owner of the laptop. My friend today sent him my phone number, but now i tried to sign in to skype and realised i forgot my password. Foolishly i changed it via email, so now the finder cannot sign in to my account to get my phone number.
    Is it possible to recover and reset my previous password, so that he can sign in? It would be the one before the change today at 10:55 CET. I changed it again since then, to the version I hope the original was, but i'm not sure.
    Thanks, paulikaron

    I haven't tried this, but there some things to think about.
    1) Have you tried to capture the Exception? Is it a problem?
    2) Have you tried to alter a password through JDBC? Is it a problem? To execute other DDL you have to use executeUpdate() I would assum that if you can do this it will also require an executeUpdate().
    Now assuming #1 and #2 are OK
    3) How are you going to change a password when the you cannot connect because the password has expired? Are you going to hard code another non-expired userid/password in the code (bad idea). Are you going to ask the user to enter some type of administrative userid/password that will allow them to change their password?
    Just some thoughts, sorry I cannot help more...

  • Trouble resetting 'expired' password on NEW MBP. It just wants to shake.

    I just bought my first Mac yesterday. It was transferring all the info from my old PC (which I am using atm) using the mirgrate program. So this morning I was ready to go, popped in my apple username and password, then when prompted again on a new screen to enter my password, it would not work. Clicked on the soccerball pic/icon and was asked to reset my password, as my old one had expired, but it just did not like it. Tried various different passwords. Restarted. Restarted in safe mode as well, and still no love. Help!

    When you first set the Mac up did you use an Apple ID and the password for it as your Computer Username and Password? If not then do not use the Apple ID. Use the Username and password you created when you first turn the system on for the first time.
    If that fails use the Username and Password that was used on your Windows PC, see if that works.
    To my Knowledge there is no place in OS X to set a expire time for a Password.
    If all else fails you can always start over by using the Recovery HD partition and Erase the drive and reload the OS.
    If it comes to that I suggest you do NOT use the Migrations system again. It simply does not work and when it does Look Like it works it leaves you with unintended consequences. Just copy over you files from PC to Mac. There is nothing else on the PC you need. No programs or setting from a PC can be used on a Mac.

  • Does not received reset apple password from my email?

    I try form reset password but i input my email dantruong460@gmail (this is my apple id)
    But login to gmail does not received anything to reset password from apple?

    you might have a rescue email on the account.. try looking in all the email accounts you own

  • Cannot reset Root password from Leopard installation DVD

    User installed Leopard with the Upgrade option, and discovered his administrator user account had been reset to standard, as described in
    http://docs.info.apple.com/article.html?artnum=306876
    However, when the user tried to follow the instructions for the password reset utility, he discovered that the User account selection pull-down was grayed out. So he cannot select the Root user, or any user account to reset the password.
    All user account have been set to standard and there appears to be no Root user.
    What next?

    Sorry. Wrong forum. Reposting.

  • How can I clear an expired password from my browser without clearing my whole cache?

    The password to one of my email accounts has expired and needs to be changed. However, Mozilla has saved it in the "password" space on my login page for this email account, and I cannot clear it. I have been told that I must clear "Forms" from my browser. However, when I follow the directions on the Mozilla site for clearing parts of my history, "Forms and Searches" is prechecked and grayed out, so clicking on it produces nothing.
    Is there a way to clear the saved password without clearing my entire history?

    Remove saved Password(s):
    * Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    See:
    * http://kb.mozillazine.org/Deleting_autocomplete_entries
    * https://support.mozilla.com/kb/Remembering+passwords

  • Reset expired password

    Hi All
    How do I turn off password expiry for an oracle user
    Im running Oracle 11i , cheers
    Thanks
    Steve

    Each user has been assigned a profile and a profile has one parameter PASSWORD_LIFE_TIME.
    PASSWORD_LIFE_TIME parameter decides when the password should expire.
    If you set PASSWORD_LIFE_TIME = unlimited, then the password wont expire for the user who is assigned that profile.
    Do following using sys/system user or user having admin rights:     
    1) find the user profile.
    select profile from dba_users
    where username = <your_user_name>;2) Check the parameter from the profile you got in step 1.
    say the profile is DEFAULT.
    select * from dba_profiles
    where profile = 'DEFAULT'
    AND RESOURCE_NAME = 'PASSWORD_LIFE_TIME';3) update the profile :
    ALTER PROFILE DEFAULT
    LIMIT PASSWORD_LIFE_TIME  UNLIMITED ;Regards,
    Dipali

  • Changing expired password from a JS page

    Hi,
    We are developing an application in which one JS page will be used to login to the database using database user id and password. If the database user id has expired then the JS page will display another JS page to change the password. While displaying the change password page can be accomplished by trapping the ORA-28001 error, can anybody tell me how actually to go about in changing the password for the user. I am not allowed to hardcode any userid and password in the JS pages for achieving this.
    Thanks in advance.
    Cheers,
    Lala

    By JS page, I'm assuming you mean JSP (Javaserver Page?)
    The answer greatly depends on the middle-tier technology you are using.. For example straight JDBC, BC4J etc..
    If you give more info on your middle tier technology we could probably help out better..
    -Chris

  • How do I reset my password from a safari only guest account?

    I can not log into my account anymore it said that my password is wrong and I never changed it. The apple store is closed due to weather, and I am only allowed access to the guest account which says it is "Safari only" I have no other option to get signed back in to do homework. I need help!!

    OS X 10.7 Lion, 10.8 MountainLion & 10.9 Mavericks
    Reset Password using Recovery HD
    Boot into Recovery Partition.
    Start the computer,then press and hold down command and R keys to start into recovery partition.
    When you see the Apple logo, release the keys.
    Wait until  OS X Utilities window shows up.
    Move the mouse to the menubar at the top and click "Utilities", then select "Terminal"
    from the drop down.
    Terminal window will appear.
    Type in   resetpassword   and press enter on the keyboard.
    Leave the Terminal window open.
    Reset Password Utility window will open with Macintosh HD selected.
    Select the user account from the popup menu box.
    Enter a new password.
    Reenter the new password for the user.
    Enter a hint.
    Click the "Save" button.
    Click  in the menubar and select Restart.

  • Is there a way to reset keychain passwords from server.app?

    We have a Lion server and a number of Macs that authenticate with the server through open directory. On occasion users have forgotten passwords, and so I've reset them from server.app. I've tried both getting them to enter their password on the server, or setting their password to "password" with reset at next login set, but both methods result in an issue whenever the user logs in where they're prompted to create a new keychain or use their old one (which is not possible because they have forgotten the password to unlock it). This is frustrating for me and users.
    Am I doing something wrong, or is this how it is supposed to work? It'd be a real pity if the latter was true, and would go against the idea that "it just works" on the Mac.

    That's the way it works. Due to the nature of a Keychain, and what is potentially stored in it, once a password is forgotten you need to use a new Keychain and all data within is "lost". If there were a way to reset the Keychain password then you can grab anyone's Keychain, insert it into another account and then use the reset password to get all of the data out of it… at which point there's little point to password protecting it at all.

  • Changing expired password

    Is it possible to change expired password from JDBC 2.0?

    By JS page, I'm assuming you mean JSP (Javaserver Page?)
    The answer greatly depends on the middle-tier technology you are using.. For example straight JDBC, BC4J etc..
    If you give more info on your middle tier technology we could probably help out better..
    -Chris

  • Changing expired password on a cbckend database from a frontend database

    I have a split database with an Oracle backend (BE) and MS Access frontend (FE). My question is how to reset an expired password on the BE from the FE.
    If I log on to the backend via sqlplus an error ORA-28001 (Password expired) occurs and the system immediately prompts for a new password before completing the login process.
    If I log on from the frontend I get the same ORA error from the BE, but as far as I can tell, I can't reset the password from the FE.
    I can capture the error fine at the FE and I am thinking that I could use this to open a dialog to reset the password and change it over the ODBC connection. The problem is that I need to get a connection to the BE database before sending a command to change the password from the FE, but since login cannot be completed from the FE, because of the expired password, I can't get an ALTER USER statement to execute on the BE to reset the password.
    Is there a way to change a pre-expired password on an Oracle backend database from a frontend database? I don't see this as an Oracle/Access problem but as a problem that exists for any split database.

    I have thought about this a little and I am thinking about keeping a table of password update information. I can use this to create a "soft" expired password, using an expiration date in the table for each account. If the password is expired by the database then we can just update it with sqlplus or one of the other options.
    As far as getting the organization to change it is waaaay to big and stupid to change their policy.

  • Resetting an Expired Password

    Hello All
    I am not sure if this is the right forum so please let me know if not.
    I currently have an ASP page that authenticates users against a Sun ONE LDAP server. The problem we seem to have is that when a users password expires, we cannot bind anymore. The easiest way for us to sort this would be to get the "Password has expired" return code but I cannot work out how to do this in ASP.
    Or is the problem deeper than this and once a password has expired a user cannot reset it? Do we need to change something else to allow a user to bind with their old password to reset their password. Remembering we are trying to do this all with asp.net.
    Thanks
    D

    I also am ignorant of asp.net; however, Sun DS 6 has several features that can help solve your problem if you can figure out how to access them:
    1. If you configure the "expiration warning" feature in the password policy, once a entry's password is in the warning period, an unsolicited "expiration warning" control is returned with each bind. The control data is the seconds until expiration. Password policy configuration is documented in http://docs.sun.com/app/docs/doc/820-2491/fhkrj?a=view . You can search for "OID 2.16.840.1.113730.3.4.5" on google for info about the control. You should also become familiar with the unsolicited password expired control "OID 2.16.840.1.113730.3.4.4". These controls are also implemented in DS5.
    2. If you supply the bind (or most other) operation with the IETF draft password policy request control, Sun DS 6.1 and later return a (properly encoded) password policy response control containing password policy operational state. Search for "OID 1.3.6.1.4.1.42.2.27.8.5.1"
    3. Your application can request the operational state of an entry via the user status control in Sun DS 6.1 and later. Search for "OID 1.3.6.1.4.1.42.2.27.9.5.8"
    4. If you have implemented some form of expiration warning, then presumably the majority of your users will have changed passwords before expiration, and you can force the others to go through some self-service or help-desk password reset function (i.e., enable must-change-on-reset, then administratively change the user's password, forcing him/her to change it at next bind).
    5. If you want to allow users with an expired password to access the DS solely for the purpose of changing the password, see http://docs.sun.com/app/docs/doc/820-2491/6ne3dhdht?a=view#resetting-expired-passwords . If you do some more investigation on Sun DS (6.2 and later) implementation of the password modify extended operation (and ldappasswd), you should find details on enabling the extension to allow a user to change an expired password.
    6. You might also take a look at http://docs.sun.com/app/docs/doc/820-2490/6ne3cisoj?a=view#pwdpol for an overview of the new password policy implementation in DS6, compared to the DS5 password policy, and the strategy to migrate from DS5 to DS6.

Maybe you are looking for