Return both user name and password

hi
I have small code
public String validateUser(String userId, String password)
throws SQLException, ClassNotFoundException{
String returnString = null;
Connection con=null;
  //get free connection from pool
   con =connectionPool.getConnection();
      Statement       stmt = con.createStatement(
                       ResultSet.TYPE_SCROLL_SENSITIVE,
                       ResultSet.CONCUR_READ_ONLY);
String sql = "select password from users where Name='"+userId+"' and password='"+password+"'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next())
returnString = rs.getString("password");
connectionPool.returnConnection(con);
stmt.close();
con.close();
return returnString;
}if I want to return both User Id and Password, How should I modify the code.
Thank you!

Hi TMary,
I think you should make wrapper class that contains userID and Password because as we are programmer knowledge, we cant return 2 objects! So maybe you should make wrapper class like
class User
public userName;
public password;
you can also make private and make public get and set method
I hope that can help you!
From wizz

Similar Messages

  • Is there any std. BAPI to check both user name and password exist or not

    Hi frnds,
    I am looking for a std. bapi to check both username and password exist or not..
    i found one bapi bapi_user_existence_check. but it checks only username...

    I don't think that you will have access to the passwords that are stored in the system.
    If so, you could read every user's password and logon to the system.
    I guess that they're encrypted and stored on the database.
    Why do you need to check for the password. Isn't the username sufficient?

  • PL/SQL Function to check user name and password

    Hi,
    I am new to PL/SQL. I have a table that stores user name and password. I want to write a PL/SQL function that checks if the entered user name and password is correct, by validation against the values in the table... Can someone help me with the code? Both user name and password is varchar2

    First of all, I believe you mean a procedure that would check the application username and password. Fot, if you mean a PL/SQL procedure, that runs in the database, and that means it has to be executed after the client application is connected to the database.
    Maybe you need a procedure like this:
    procedure check_pass(p_user varchar2, p_pass varchar2) is
    pragma autonomous_transaction;
    v_passwd varchar2(200);
    begin
    select passwd into v_passwd
    from password_table
    where user_name=p_user;
    if v_passwd!=p_pass then
    update password_table set
    last_unsucc_logon=sysdate
    ,unsucc_logon_n=nvl(unsucc_logon_n,0)+1
    where user_name=p_user;
    commit;
    raise_application_error(-20101,'Invalid username/password!');
    end if;
    exception
    when no_data_found then
    raise_application_error(-20101,'Invalid username/password!');
    end;
    Study this piece of code and see if this will do.

  • Leopard Safari requires reloading user name and password

    Tried asking this another way and no one answered, which left me to wonder if no one on this forum knows the answer or it I wasn't clear in asking it? Let me be more specific: Leopard Safari requires a user name and password to be entered each time an appropriate web site is opened, even when "refresh" is clicked. For example, I use "myyahoo" for the homepage, but now each time I open Safari, I am required to reenter the user name and password. Ditto every site I have saved autofill data for. This did not happen with Tiger, prior to upgrading to Leopard last Friday. I also tried phoning the Apple Care support number -- a 37 minute wait produced someone who said my call needed to be forwarded to the Safari desk, and likely involve another extensive wait. So I gave up that idea and am trying here again. Help!

    Thank you! In Preferences, all the autofill boxes are checked. Just to be sure, I unchecked them all then rechecked them. Autofill form works in Edit. Before the upgrade, Safari was able to maintain user names and passwords on sites where I wanted them. After the upgrade Friday evening, Safari stopped doing this on all sites where I already had a user name and password, including the Mac site. Simply, I am now required to re-enter this information every visit to every site, even if I just click refresh, not only when I exit Safari and return. Even if I leave a site where I have entered the password, visit another site, and then return, the user name and password must be entered again. I have still had no luck getting Apple Care on the phone. This morning I bit the bullet and decided to wait until finally somebody answered, but no amount of patience can listen to scratchy wait music for more than 45 minutes, which is when I gave up. So if someone here doesn't understand this, guess I'm stuck having to enter this information again and again and again... or figure out how to get back to Tiger.

  • I receive an error stating user name and password are not valid on my ipad and iphone 3Gs when attempting to load email from my icloud account. When I log onto icloud from my Mac, it wont load the email either.

    One day, my ipad and iphone pick up my emails (.mac account) from icloud just fine. the next day, I recieved error messages that say my user name and password are not accurate. I removed the icloud program on both devices and added it back on to both devices and get the same message. I logged into icloud from my Mac and while I can log in, it times out when I select email and wont load the email there either. Any Suggestons?

    I am having the same problem; it started about 24-36 hours ago.
    I know my ID/PW combo are correct because I can access all other aspects of iCloud except mail.
    iPhone -- returns incorrect ID / Password
    iPad -- Same
    Mail.app on Mac -- returns incorrect password error
    icloud.com -- allows me to log in and use all functions accept mail.  When I try to use mail it stays on a white screen for about 60 seconds then returns a dialogue box that indicates a server error.
    I contacted Apple and they placed my iCloud account into something called "Troubleshooting" mode.  They generated a new strong password and sent it on to "Engineering."
    I suspect there are a small number ofo users like you who are affected with the same problem I am.  Too small a number for it to be reported as an outtage.  I suggest you call Apple and open a case to have your mail investigaged.
    Hope this helps...

  • User name and password for Oracle BI Spreadsheet Add-in

    Dear all,
    I downloaded Oracle Database 10g Express Edition and I installed it successfully. I created a new account. Then I downloaded Oracle Business Intelligence Spreadsheet Add-in and I installed it successfully as well (both on my PC).
    Now I would like to run Oracle Business Intelligence Spreadsheet Add-in but I don't know the way of running it. I click "New query". Then I go to the "Connection editor". There are four boxes.
    "Description box" is clear. I write 127.0.0.1 or k219 (it's the name of my computer) into the "Host name box". As the "Port Number box" I use 1521. Then I write xe into the "SID box".
    Then I return to the "OLAP connection tab". There are items: user name and password. I try to write user name and password created in Oracle Database 10g Express Edition. And the result is an error: Faild to connect to OLAP service
    BIB-10701 An error occured during connecting to metadata
    oracle.dss.metadataManager.common.MetadataManagerException: BIB-10701 An error occured during connecting to the database
    oracle.dss.connection.common.ConnectionException: BIB-16627 It's not possible to connect to the databse
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00201: identifier 'OLAPIBOOTSTRAP' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please, is there anyone who can help me?
    Your user Frank

    When u install Oracle 10g, it forces u to enter new passwords for System as well as scott user and it does not allow u to keep old know passwords as manager and tiger.
    If u installed with new passwords successfully, u must be knowing those new passwords and there is no reason to try with system/manager. Instead try to connect with new passwords. We never faced such problems.
    If the problems still persits, check that
    a) Oracle service is running
    b) Instance is running by and whether u are able to connect / as sysdba
    Suresh Bansal

  • Need User Name and Password for External Firewire new hard drive

    In the past, I've worked with two 250 GB PATA drives in my G4, one inside and one in an external Firewire enclosure. I used Carbon Copy Cloner to copy and maintain all system and user files from the internal drive to the external drive. The external drive would boot just fine. These two drives were both partitioned with 74.5 and 158.4 GB partitions with the system files on the smaller.
    The internal drive died so I bought a new 500GB drive and installed it in the external enclosure and moved the former external drive inside the G4.
    I again used CCC to copy the system and user files to the new 500GB drive.However, I only gave it one 465.8GB partition. I cannot make the external drive complete the boot process. It stops and demands a user name and a password. I've not been able to supply ones which work.
    I have remembered and entered the user name and password which were installed when I partitioned the 250 GB drives years ago. The window thinks a few seconds and then shakes back and forth and then clears the data entry boxes so that I can try again.
    I do have an Install DVD for Tiger 10.4 (bought from Apple) and have been able to use that to go back and change the root or administrator password and the User password on the computer. That has not solved my problem.
    I have read about 25 pages of this forum and not seen any posts that referred to password problems with only the external hard drive. But I've seen some very knowledgeable answers to other people's posts.
    Please help.
    Gil

    Generally, when Mac OS X is asking you for a username and password, it is when you are doing something that requires an Administrator password, such as repairing a hard drive's Directory or making major changes to quasi-System things.
    So Carbon Copy Cloner and Disk Utility are likely asking for an Administrator user_id and password. It will not take a simple carriage return as an answer -- the operation will not complete without that Admin authorization.
    If you are among the \[estimated five or six] people who actually read the manual and followed the advice to use a non-admin password for your day-to-day computer work, you may not even remember the Admin username and password.
    If you have an Installer CD, you can boot to the Installer CD and choose Reset Password off the Installer menu (10.3 and earlier) or the Utilities menu (10.4 and later). There is also an Installer-compatible version of Disk Utility there, and while booted from the CD is an ideal Time to Repair your main Hard Drive, while it is not being used for booting the System.

  • How to pass user name and password in openConnection method ?

    Hi, Exports,
              I am trying to post data from applet to another application which is
              protected by network password.
              How to pass user name and password when I use openConnection method? In java
              doc, this method looks like do not accept these two parameters.
              Thanks
              ----- my code in applet ---------
              URL url = new URL("http://127.0.0.1/xml/index.cfm");
              URLConnection connection = url.openConnection();
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              dos.writeBytes("Content-Type:
              multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              dos.writeBytes("Host: "+host+":"+port+"\r\n");
              dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              dos.writeBytes("Connection: Keep-Alive\r\n\n");
              dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              on: form-data;name=\"xmlDoc\"\r\n\r\n");
              dos.writeBytes(buff.toString());
              dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              dos.close();
              

    you need to negotiate Authentication in ur applet code...
              For example:
              If u r using Form based auth u need to send Post a request with j_user_name &
              j_password to the action j_security_check. and when server returns back the
              cookie
              u need to hold it and pass that cookie to the each and every request made to the
              protected application.
              Basically u need to imitate the browser.
              regards
              aseem
              David wrote:
              > Hi, Exports,
              >
              > I am trying to post data from applet to another application which is
              > protected by network password.
              > How to pass user name and password when I use openConnection method? In java
              > doc, this method looks like do not accept these two parameters.
              >
              > Thanks
              >
              > ----- my code in applet ---------
              > URL url = new URL("http://127.0.0.1/xml/index.cfm");
              > URLConnection connection = url.openConnection();
              > connection.setDoInput(true);
              > connection.setDoOutput(true);
              > connection.setUseCaches(false);
              > connection.setAllowUserInteraction(false);
              > DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              > dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              > dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              > dos.writeBytes("Content-Type:
              > multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              > dos.writeBytes("Host: "+host+":"+port+"\r\n");
              > dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              > dos.writeBytes("Connection: Keep-Alive\r\n\n");
              > dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              > on: form-data;name=\"xmlDoc\"\r\n\r\n");
              > dos.writeBytes(buff.toString());
              > dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              > dos.close();
              >
              > ------------------------------------------
              

  • User Name and Password to file share OSX and Vista

    I have just bought a Laptop running VISTA for work. I want to share files between my i-mac and the lap top. I have managed to share from MAC > Vista but can not log onto the MAC from Vista.
    I map the drive using \\192.168.2.2\kemery and am then prompted for a user name and password so enter my MAC short name and password (administrator). The log on fails and returns "unsucessful" with the user name filled in as
    KeithEmery-PC\kemery. I have tried changing it to WORKGROUP\kemery but nothing seems to work.
    Please help - this is the last task on an otherwise simple setup!

    I left off the \\ that is before the 192.168.2.2 and it worked just fine for me. But I am using Vista Ultimate and this may or may not make a difference. Ultimate is suppose to have easier Networking set - up
    I map the drive using \\192.168.2.2\kemery and am
    then prompted for a user name and password so enter
    my MAC short name and password (administrator). The
    log on fails and returns "unsucessful" with the user
    name filled in as
    KeithEmery-PC\kemery.

  • When I enter my user name and password for my e-mail account, the page won't open

    My e-mail account page won't open after I enter my user name and password on the log-in page. I have vcrified with Suddenlink that my user name and password are correct.

    Thanks Peter.
    Partial success in that I have been able to get mails onto the iPad  - however....
    Progress from a previous 'rumage' on problem discussions.    I have succeded in setting up the iPad so that it receives emails from the sky address under 'MAIL' on the iPad.    However trying to open in the 'usual' way   -  safari - then sky  -  then email  -  enter user name and password  -  I get the same result  -  it just returns to the log in menu for sky email with user name and password blank. 
    I had a previous problem with the sky mail ceasing to show recent mails, frozen in time on the iPad.   Somehow by trying some reset instructions I was able to 'unlock' the iPad and all was OK until it 'froze' again.    This time I clearly screwed up attempts to unlock, resulting in not being able to access email accounts via the Sky site !!

  • What is user name  and password for SLES10 SP1 SAP Version

    Hello,
    In order to install SAP NetWeaver 7.0 - Java and ABAP Trial Version on Linux - VMware Edition , I download SLES10 SP1 Vmware SAP version from novell, when I played SLES10SP1_Test_Drive.vmx,
    the suse linux enterprse server was start. It asked me to input user name and password. I input slesuser and password is novell. But it was not correct. Who knows what user name and password I need input?
    any help ?
    Best Regards,
    George

    Hi
    I have the same issue, I tried user root and password root doesn't work I've tried couple fo "stupid" word or root user but didn't work
    Looks like we both missing file "index.html" so I suppose this is bug from Novell and SAP
    I will let you know if I found anything.
    Peter
    See this forum you question
    Where to download SLES10 SP1 SAP Version?

  • Reset user name and password

    I bought a macbook air from best buy as an open item.  The previous owner must have set up a user name and password.  I try to download adobe but it wont let me bc of the previous username and password.  How do I master reset that.  Thank you

    I had a Genius Bar appointment on Saturday for one reason, and one reason only.
    I wanted buy a Lion thumbdrive for my mid 2011 MBA (which comes with Lion), and wanted to know for a fact that it would work on my unit. I had asked a question in the Apple online store Q&A, what version was being used on these Lion thumbdrives and was answered by a user that it was 11A511. Someone else in the Q&A's had asked whether it would work on the 2011 MBA's, and someone answered that it could. Whoever moderates those Q&A's had marked both answers as being correct. But in fact, the two answers completely contradict one another.
    So, I went to the Genius Bar to see if could find out the real answer.
    First, I asked if it would work. The Genius Bar technician first treated my question as irrelevant. He waned to contend that with the Recovery Partition, the disk was completely unnecesary, as one could simply repair any installation with their own drive. I countered with the scenario that I wanted the drive in case of a hardware failure that would leave the Recovery Partition damaged or non-existent, such as with a new drive. He countered with that I should then use the Recovery Assistant created "rescue drive", I could then download Lion and install it to a new SSD.
    I incisted that I wanted the drive to be something that would permit me to be completely self-sufficient, even without an internet connection.
    It was only then that he ceded to my request to find out if the build number was sufficient to use on my MBA. He both confirmed that it was build 11A511 (actually 11A511a), and that it was a build that DID NOT have the necessary components to work on either a mid 2011 MBA or a mid 2011 Mac Mini, as they require 11A2063 & 11A2062, respectively.
    I asked if he had any knowledge as to when Apple might revise the disk offering to a later build or even the now current 10.7.1, and he had no information on the subject (after he consulted with other store personnel).

  • Invalid User Name and Password when logging onto BPM Workspace (v9.3.1)

    I have installed Hyperion Planning and the related/required products. When I attemp to log on to Workspace, I get the following message;
    'You must supply a valid User Name and Password to log onto the system."
    I have tried using the native 'admin' account, and an NTLM account that I have setup. Both of these accounts work for logging onto the the User Management Console and to the Essbase Administration Console, and I have provisioned both of them with full admin privileges.
    Has anyone encountered this issue?
    Thanks,
    -K

    Thank you all for the responses so far.
    On the first response, I had already provisioned an NTLM user that is a member of the local Administrators group with all administrative roles, and also refreshed security in EAS prior to submitting this inquiry, so that did not solve the problem.
    On the second, I cannot navigate to ../workspace/browse/configinfo without logging in so I am unable to review this information.
    On the third response, where do you provision the user to BI+? If I open the User Management Console, there are four root roles each with a tree underneath: APS 9.3.1 Server, Analytic Servers, Business Rules, and Hyperion Shared Services. Under each tree, I have provisioned the 'admin' user and the NTLM user for all roles, including Administrator, Dimension Editor and Application Creator under Hyperion Shared Services -> Global Roles. Should there be a BI+ tree? If so, it is not appearing on the list.
    Thanks for any additional info anyone can provide.
    -Ken

  • Problems with invalid user name and password

    We have a one week old MacBook 2.2GHz basic white model that is generally working well.
    However a problem has now arisen whereby on any attempt to shutdown or restart it won't accept the administrator user name and password, returning an 'invalid' warning. The issue seems to be the user name as the administrator password has worked OK in other situations. Naturally I have checked and re-checked the user name (which was in the form (first name followed by surname in upper and lower case) and it was OK (in any case it was being prompted automatically by the system.)
    I have subsequently changed the administrator name (to the form first name only in upper and lower) and the password as suggested by the following article:
    http://docs.info.apple.com/article.html?artnum=306876
    Nothing has changed. Can anyone help?

    HI Martin, a late post to confirm the solution from the last post by using the "RETURN" key works..
    (mouse click worked ok in Tiger 10.4.x I thought).
    Tis was a delight and so obvious after seeing these symptoms.
    I have posted this entry in case anyone else get's into this situation since OSX LEopard 10.5. Several people have encountered this issue where they may have:
    • LEopard 10.5.x installed
    • have 2 or more active users LOGGED into the OSX system via fast user / fastuser switching
    • request a SHUTDOWN or RESTART from an user
    • get a OSX request to supply administrator attributed user and it's associated password to validate SHUTDOWN | RESTART request,
    • have admin | root account verification failure of password after 'clicking'.
    After some months of frustration, it seems a simple PRESS of the "RETURN key" works!
    Simply, DON'T mouse click after entering admin user/password.... instead press "RETURN" key.
    fwiw.
    w

  • EBS 7.3 "Could not authenticate this user name and password, try again"

    I have just install Sun StorEdge Enterprise Backup Software 7.3 on a new Solaris 10 (06/06) system. I have installed the following packages with no errors: SUNWebsc (Client), SUNWebsn (Storage Node), SUNWebss (Server), SUNWebsm (Man pages) and SUNWebsg (Console).
    I have executed the �nsraddadmin� command for both root and administrator.
    I start the web browser with http://<hostname>:9000 and the java software loads with no errors. But when I try to login for the first time with administrator/administrator, I get the follow error:
    ERROR: Could not authenticate this user name and password, try again�

    I think the client is not able to do a HTTP POST
    to the WLS server but it can do a HTTP GET.
    I dont know why.
    http://manojc.com
    "Ganesh" <[email protected]> wrote in message
    news:3eba91bc$[email protected]..
    >
    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment.When I
    invoke the web service through my browser (IE 6.0) using the web servicesurl,
    it brings my service method correctly. From there, if I click the invokebutton
    it asks me for a network user name and password under "weblogic" realm???If I
    provide the admin user credentials (which I supplied while creating mydomain)
    it is not accepting that it keeps popping up this network user passwordwindow
    over and over. Not sure which username/password I have to provide here tosee
    the result of my service.
    If I try to invoke the web service through my client (static) I am gettinga connection
    refused exception. I guess either way, I am not able to access my webservice.
    In the attached file, I have cut and pasted the client stack trace as wellas
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh

Maybe you are looking for