Returning the string from the SimpleDateFormat

Hi guys,
Can someone tell me how to return the string from the SimpleDateFormat?
I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
    public String convert (Calendar gc)
        String s = convert(gc);
        return // I need to return the s here, but don't know how to code it.
    }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

DrLaszloJamf wrote:
LevelSix wrote:
DrLaszloJamf wrote:
No.Can you tell me what it is, because i've went through the API and i don't know.
Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
Thanks a lot DrLaszloJamf, this is useful.
DrClap wrote:
Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

Similar Messages

  • How to retreive String from the Connection object

    hi all,
    I am using HttpConnection to Connect to the server.I want to retreive string from the Connection.
    As like Connection.openInputStream() is there any method to get the String from the connection.In the server side also i want to send the String not the stream .
    Thanks in advance
    lakshman

    Just read the string from the stream.

  • Awk returns different string from what appears to be the exact same?

    Hey, this is more of a general awk issue. 
    I'm running Arch on an x200 Thinkpad tablet and trying to improve on the rotate script in the wiki.
    Currently, the wiki's script has predefined values for the stylus/eraser devices that don't work for all systems (mine for example).  I would like to make it so that these device names are discovered by the script at runtime so that the user doesn't have to edit the script to make it work.
    In order to do this, I'm using
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print}')"
    and likewise for the eraser.
    The problem is that when the script runs, it says "Cannot find device 'Serial Wacom Tablet stylus'." even though that's the exact thing I had in the script before messing with the variable assignment. 
    What makes these strings different? Is there some nuance of awk that I'm missing?

    #!/bin/bash
    #### rotate.sh - A script for tablet PCs to rotate the display.
    ## This software is licensed under the CC-GNU GPL.
    ## http://creativecommons.org/licenses/GPL/2.0/
    ## http://wiki.archlinux.org/index.php/Tablet_PC
    ## REQUIRES: linuxwacom (http://linuxwacom.sourceforge.net/)
    #### Function(s)
    function set_normal {
    xsetwacom set "$stylus" Rotate 0
    xsetwacom set "$eraser" Rotate 0
    xrandr -o normal
    function set_right {
    xsetwacom set "$stylus" Rotate 1
    xsetwacom set "$eraser" Rotate 1
    xrandr -o right
    function set_left {
    xsetwacom set "$stylus" Rotate 2
    xsetwacom set "$eraser" Rotate 2
    xrandr -o left
    function set_inverted {
    xsetwacom set "$stylus" Rotate 3
    xsetwacom set "$eraser" Rotate 3
    xrandr -o inverted
    #### Variable(s)
    orientation="$(xrandr --query --verbose | grep connected | grep -v dis | awk '{print $5}')"
    eraser="$(xsetwacom --list | grep ERASER | awk '{$NF="\b"; print $0}')"
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print $0}')"
    #### Main
    if [ "$orientation" = "normal" ]; then
    set_right
    elif [ "$orientation" = "right" ]; then
    set_inverted
    elif [ "$orientation" = "inverted" ]; then
    set_left
    elif [ "$orientation" = "left" ]; then
    set_normal
    fi
    #### EOF
    Like I said, a slight modification of the original wiki script. 
    xsetwacom --list returns
    Serial Wacom Tablet stylus STYLUS
    Serial Wacom Tablet eraser ERASER
    Edit:
    I whipped up a short script to illustrate my problem
    #! /bin/bash
    therightthing="Serial Wacom Tablet stylus"
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print}')"
    if [ "$therightthing" = "$stylus" ]; then
    echo "Equal"
    else
    echo "Not Equal"
    echo "$stylus |"
    echo "$therightthing |"
    fi
    The vertical line is my check for trailing whitespace.  When run, it returns that they're not equal, but the strings look the exact same.
    Output:
    Not Equal
    Serial Wacom Tablet stylus |
    Serial Wacom Tablet stylus |
    Last edited by Pursuit (2010-09-27 23:05:39)

  • XML Report completes with error due to REP-271504897:  Unable to retrieve a string from the Report Builder message file.

    We are in the middle of testing our R12 Upgrade.  I am getting this error from the invoice XML-based report that we are using in R12. (based on log).  Only for a specific invoice number that this error is appearing.  The trace is not showing me anything.  I don't know how to proceed on how to debug where the error is coming from and how to fix this.  I found a patch 8339196 that shows exactly the same error number but however, I have to reproduce the error in another test instance before we apply the patch.  I created exactly the same order and interface to AR and it doesnt generate an error.  I even copied the order and interface to AR and it doesn't complete with error.  It is only for this particular invoice that is having an issue and I need to get the root cause as to why.  Please help.  I appreciate what you all can contribute to identify and fix our issue.  We have not faced this issue in R11i that we are maintaining right now for the same program which has been running for sometime.  However, after the upgrade for this particular data that the user has created, it is throwing this error REP-271504897.
    MSG-00100: DEBUG:  Get_Country_Description Return value:
    MSG-00100: DEBUG:  Get_Country_Description Return value:
    REP-0002: Unable to retrieve a string from the Report Builder message file.
    REP-271504897:
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-271504897: MSG-00100: DEBUG:  BeforeReport_Trigger +
    MSG-00100: DEBUG:  AfterParam_Procs.Populate_Printing_Option
    MSG-00100: DEBUG:  AfterParam_Procs.Populate_Tax_Printing_Option
    MSG-00100: DEBUG:  BeforeReport_Trigger.Get_Message_Details
    MSG-00100: DEBUG:  BeforeReport_Trigger.Get_Org_Profile.
    MSG-00100: DEBUG:  Organization Id:  117
    MSG-00100: DEBUG:  BeforeReport_Trigger.Build_Where_Clause
    MSG-00100: DEBUG:  P_Choi
    Report Builder: Release 10.1.2.3.0 - Production on Tue Jul 23 09:56:46 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.

    Hi,
    Check on this note also : Purchasing Reports Fail When Changing Output To XML REP-0002 REP-271504897 REP-57054 (Doc ID 1452608.1)
    If you cant reproduce the issue on other instance, apply the patch on the test instance and verify all the funcionality related to the patch works OK. Then move the patch to production. Or you can clone the prod environment to test the patch.
    Regards,

  • Weird one..  i can't return a variable from the extended to the super class

    Hey everyone, i hope i'm not annoying you guys :)
    So today's problem is to return a variable (int) from a method of the extended class and print it ont the super class.
    I'm just testing the super class , if it works fine.
    So the extended class ( FileIO) just read the file txt and return the integer or string ( from the txt file)
    I already did a main method to that class and tested it, it works fine.
    So now the problem is to print the integer ( that the extended class gets from the txt. ) inside the Super class. I mean , is the same thing but now im testing the Super class , just have to do the same thing, a super class method calls the extended class method and receive the integer from the txt file.
    i think the problem is when i create the instance of the FileIO object , maybe its constructor ...i don't know.
    The name of the txt file is passed from the super class to the extended class, but i think the error is not from there.
    this.aero_le = new BufferedReader(new FileReader(super.ficheiroleitura_aero()));  //  super calls ficheiroleitura_aero()  and receive the name of the txt file ( e.g "temp.txt")  so i think that is correct.
    here's the code of the Super class public class Aeroporto {
         private String filereader_voo = "temporary.txt";
         private String filereader_aero = "temp.txt";
         private String siglaAero = "";
         public FileIO file;
         public Aeroporto(){};
         public Aeroporto(String filereader_voo, String filereader_aero) throws IOException{
              this.filereader_voo = filereader_voo;
              this.filereader_aero =filereader_aero;     
              file = new FileIO();
         public String siglaAero() {
              return siglaAero; }
         public String filereader_aero(){
              return filereader_aero;
    public int nrLines() throws IOException{   // it was supose to retunr the number of lines ( integer) from the txt file .
              return Integer.parseInt(file.lerLinhaN(1,1));
    // main() {
    Aeroporto a = new Aeroporto();
              int v = a.nrLines();
              System.out.print(v);
    // ***********************************************************+
    // Extended Class
    public class FileIO extends Aeroporto{
         private String ficheiroescrita;
         private PrintWriter vooescreve, aeroescreve ;
         private BufferedReader voo_le, aero_read;
         public FileIO(){}
         public FileIO(String filereader_voo, String filereader_aero, String ficheiroescrita) throws IOException {
              super(filereader_voo, filereader_aero);
              this.ficheiroescrita = ficheiroescrita;
              //If file does not exists , create one.
              try{
                   this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
                   aero_read.close();
              catch(IOException ex){
                   this.aeroescreve = new PrintWriter(new FileWriter(ficheiroescrita));
                   aeroescreve.close();
    public String lerLinhaN(int line, int column) throws IOException{  // this method works fine , i already tested this class.
              this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
              for(int i = 0; i != line-1; ++i) aero_read.readLine();
              String linha = aero_read.readLine();
              String [] words = linha.split(" ");
              return words[column-1];
    Maybe the error is that i use to test the Super class a default contructor on both classes... i don't know where the error is, i also did two small classes ( super and another that extends ) and get the string "Hello" from the super and print it inside the extended..and it works, that's why i think the error is when i call the extended class .. need help.
    thanks.

    Ok,
    This one might actually work... atleast it compiles.import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    import java.io.PrintWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public abstract class FileIO {
         public static boolean CreateOutputFileIfNotExists(
              String outputFilename //the name of the file to ensure exists.
         ) throws IOException
              final String functionName = "FileIO.CreateOutputFileIfNotExists";
              boolean retVal = false;
              //If the output file does does not exist then create it.
              //post condition: output file exists or an IOException has been thrown.
              BufferedReader infile = null;
              try{
                   infile = new BufferedReader(new FileReader(outputFilename));
                   retVal = true;
              } catch(IOException ex) {
                   PrintWriter outfile = null;
                   try {
                        outfile = new PrintWriter(new FileWriter(outputFilename));
                        retVal = true;
                   } catch(IOException ex2){
                        throw new IOException(functionName + ": cannot create output file " + outputFilename, ex2);
                   } finally {
                        outfile.close();
                        if (outfile.checkError()) {
                             throw new IOException(functionName + ": error on output stream " + outputFilename);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close output file " + outputFilename, ex);
              return(retVal);
         public static String readLine(
                   String  inputFilename //the name of the file to read.
              , int     lineNumber    //1 based number of the line to read from.
         ) throws IOException
              final String functionName = "FileIO.readLine";
              String outputLine = null;
              // reads the numbered "lineNumber" from "inputFilename".
              BufferedReader infile = null;
              try {
                   infile = new BufferedReader(new FileReader(new File(inputFilename)));
                   for(int i=1; i<lineNumber; ++i) infile.readLine();
                   outputLine = infile.readLine();
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close input file " + inputFilename, ex);
              return(outputLine);
         public static String readWord(
                   String inputFilename  //the name of the file to read.
              , int lineNumber        //1 based number of the line to read from.
              , int wordNumber        //0 based number of the word to read.
         ) throws IOException
              final String functionName = "FileIO.readWord";
              String outputWord = null;
              // reads the numbered space-seperated "wordNumber" from the numbered "lineNumber" of "inputFilename"
              try {
                   String[] words = FileIO.readLine(inputFilename, lineNumber).split(" ");
                   if (wordNumber>0 && wordNumber<words.length) outputWord = words[wordNumber-1];
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              return(outputWord);
    }Design notes... FileIO is a generic helper class... there is nothing specific to Airports, flights, or any other "domain" specific stuff in it... so it's re-usable... you can keep it and reuse it on other projects, or even share it with your friends.
    So... The airport class will just call the static methods on FileIO like this    ....
        int lineNumber=1;
        int wordNumber=1;
        String airportCode = FileIO.readWord(airportsFilename, lineNumber, wordNumber);
        ....How's that?
    corlettk: my now mandatory edit.

  • Help Please..Until recently I have owed 2 iPod Classics - 2007 80gb and 2009 160gb (which has since been returned). How do I transfer the library from the 160 to the 80gb in iTunes using Windows Vista (ie merge the 2 libraries)? Thanks

    Until recently I have owed 2 iPod Classics - 2007 80gb and 2009 160gb (which has since been returned as it had a very noisy hard drive).
    How do I transfer the library from the 160gb  to the 80gb in iTunes using Windows Vista.
    Nothing seems to help on the Apple support pages, so any help would be appreciated
    Thanks

    Thanks for the reply, but not actually sure how to sync a second iPod with the library of the first, as I thought it would not recognise a new iPod for copyright reasons.
    Also, the files are in a location on the pc but I had to do lots of formatting amendments in iTunes as most of the stuff was on mp3 files and the formatting was all over the place. I did not want to loose any of the work by simply asking the new iPod to look at the original file and would rather copy en masse from one device to another.
    Any help or pointers greatly appreciated
    Thanks

  • REP-0002: Unable to retrieve a string from the Report Builder message file;

    Hi,
    I've a custom report in which i need to display a large string, of more than 4000 characters. To cater to this requirement i've written a formula column which displays string upto 4k characters and for a string of size beyond 4k i am calling a procedure which uses a temp table having a clob field.
    For a small string the report runs fine but whenever a large string requirement comes into the picture, said procedure gets triggered and i get REP-0002: Unable to retrieve a string from the Report Builder message file.
    OPP log for the same gives an output as under:
    Output type: PDF
    [9/21/10 2:17:12 PM] [UNEXPECTED] [388056:RT14415347] java.io.FileNotFoundException: /app/soft/test1udp/appsoft/inst/apps/e180r_erptest01/logs/appl/conc/out/o14415347.out (No such file or directory)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:241)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:172)
    Report Builder 10g
    BI Publisher's version : 4.5.0
    RDBMS Version : 10.2.0.4.0
    Oracle Applications Version : 12.0.6
    Searched for the same on metalink and found Article ID 862644.1, other than applying patch and upgrading version of BI Publisher is there any other workaround to display a comma seperated string as long as 60k characters, If any please suggest.
    Thanks,
    Bhoomika

    Metalink <Note:1076529.6> extracts
    Problem Description
    When running a *.REP generated report file you get errors:
    REP-00002 Unable to retrieve string from message file
    REP-01439 Cannot compile program since this is a runtime report
    Running the same report using the *.RDF file is successful.
    You are running the report with a stored procedure,
    OR you are running against an Oracle instance other than the one developed on,
    Or, you recently upgraded your Oracle Server.
    Solution Description
    1) Check that the user running the report has execute permissions on any stored
    SQL procedures called. <Note:1049458.6>
    2) Run the report as an .RDF not an .REP , that is remove or rename the .REP
    version of the report. <Note:1012546.7>
    3) Compile the report against the same instance it is being run against.
    <Note:1071209.6> and <Note:1049620.6>

  • Problem - reading an abitrary string from the command line in basic swing

    Hi,
    I'm sorry if this problem is a bit basic, but I've only just started swing in Java. Anyway, I'm trying to adapt a basic swing version of the HelloWorld class. When I try to pass an abitrary string from the command line to the label within the class, I get the following error,
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
            at week2.HelloWorldSwing_commandline.main(HelloWorldSwing_commandline.java:31)
    Java Result: 1I must be missing something because I can't see where the problem is in the following code.
    import javax.swing.*;
    import java.awt.*;
    public class HelloWorldSwing_commandline {
        String message;
        private static void createAndShowGui(String message){
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("HelloWorldSwing");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JLabel label = new JLabel(message);
            Container content = frame.getContentPane();
            content.add(label);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[ ] args) {
         createAndShowGui(args[1]);
    }Any help would really be appreciated.

    Hi,
    I've tried changing the index value to O in the main method, but I still get the same error.
    I'm running this in NetBeans 4.1, and when I try to run the class I get the error as listed above.
    Any ideas how to correct this error?
    Thanks

  • How to search a string from the database?

    how to search a string from the database? starting with some character

    If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
    Here's an Example
      SELECT obj_name FROM tadir
        INTO prog
        WHERE pgmid = 'R3TR'
          AND object = 'PROG'
          AND obj_name LIKE 'Z%'.
    In this case it will select every row that obj_name starts with Z. 
    If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
    Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

  • How to design and implement an application that reads a string from the ...

    How to design and implement an application that reads a string from the user and prints it one character per line???

    This is so trivial that it barely deserves the words "design" or "application".
    You can use java.util.Scanner to get user input from the command line.
    You can use String.getChars to convert a String into an array of characters.
    You can use a loop to get all the characters individually.
    You can use System.out.println to print data on its own line.
    Good luck on your homework.

  • If the result from the stored procedure returns 0 rows I get this error returned:

    If the result from the following stored procedure returns 0
    rows I get this error returned:
    faultCode:Server.Processing faultString:'Variable transfers
    is undefined.' faultDetail:''
    How can I get round this?

    Well if I try this in a cfm page:
    <cfstoredproc procedure="GetTransfers"
    datasource="datasource" returncode="true">
    <cfprocparam type="in" cfsqltype="CF_SQL_VARCHAR"
    value="4">
    <cfprocparam type="in" cfsqltype="cf_sql_date"
    value="12/09/2006 08:42:00">
    <cfprocparam type="in" cfsqltype="cf_sql_date"
    value="12/09/2008 08:42:00">
    <cfprocresult name="transfers">
    I get an error like:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Procedure or
    function 'GetTransfers' expects parameter '@fromdate', which was
    not supplied.
    But this procedure only accepts 3 parameters.

  • How can i Pick the data from the string

    Hi Gurus
    How can i Pick the data from the string using regular expressions. for ex:
    1) 10000-san0001
    2) 3000000-rani0001
    3) 30-super003
    its doesnt mainain how many characters.
    like this i got string. now i only want  after the symobl( -) text (san
                                                                                    rani
                                                                                    super)  .how can i pick that
    can anyone provide me regular expressions.
    Thanks & Regards
    Sandya
    Edited by: sandya rani on Jan 29, 2010 2:51 PM

    REPORT  ZTEST.
    data: str1 TYPE string,
    str2 TYPE string,
    str3 TYPE string,
    lenth TYPE string,
    str4 TYPE string,
    temp type i value '0'.
    data: ii type i value '0',
          jj type i value '1'.
    Data : begin of itab OCCURS 0,
    l_string type string,
    end of itab.
    itab-l_string = '3000000-GUNDALA20001'.
    append itab.
    clear itab.
    itab-l_string = '2045677-iCVj1001'.
    append itab.
    clear itab.
    itab-l_string = '3000-ragh30001'.
    append itab.
    clear itab.
    loop at itab.
      MOVE 0 TO ii.
      MOVE 1 TO jj.
      SPLIT itab-l_string AT '-' INTO: str1 str2 .
      clear: itab-l_string,str1.
      lenth = strlen( str2 ).
      while temp < lenth.
        str4 = str2+ii(jj).
        if str4 CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' or str4 CA 'abcdefghijklmnopqrstuvwxyz'.
          if sy-subrc = 0.
            CONCATENATE str3 str4 into str3.
          endif.
          ii = ii + 1.
        ENDIF.
        temp = temp + 1.
      ENDWHILE.
      write: / str3.
      clear: itab, ii, jj,str1, str2, str3, str4,temp, lenth.
    Endloop.

  • How to get the values from the resultset???

    I have a problem with this code given below,
    i am executing an sql query which return a union of values from two tables.
    the problem here is how do i read the values from the resultset.
    here is the code....
    package com.webserver;
    import java.sql.*;
    public class UnionDemo{
    public static void main(String args[]){
    Connection connection =null;
    Statement statement =null;
    ResultSet rs =null;
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    connection = DriverManager.getConnection("jdbc:oracle:thin:@:1521:ORCL","scott","tiger");
    statement = con.createStatement();
    rs = statement.executeQuery("(select tablename from node where appid=432) union (select tablename from uomnode where appid=432)");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next()){
    System.out.println(rs.getString(1));
    // instead of rs.getString(1) I also used rs.getString("tablename") but of no success....
    }//end of while
    }catch(Exception exp){
    exp.printStackTrace();
    finally{
    try{
    if (rs!=null) rs.close();
    if (statement!=null) statement.close();
    if (con!=null) con.close();
    }catch(Exception exp1){
    exp1.printStackTrace();
    }//end of finally
    }//end of main
    }//end of class
    when i execute this program i get an oracle error ORA-01009
    which says (java.sql.SQLException: ORA-01009: missing mandatory parameter)
    can anyone help to retrieve the values from this resultset...
    thanx

    [cut]
    i am executing an sql query which return a union of
    values from two tables.
    the problem here is how do i read the values from the
    resultset.[cut]
    When the error occours?
    1) Executing query ?
    2) Retrieving the field from the resultSet ?
    3) ecc. ?
    BTW, first of all, try to execute the query removing the parenthesis
    of the two select statement. I know that there are some problem
    with the oracle jdbc driver about them.
    Hope it helps.

  • How to get the value from the checkbox

    Hi All,
    Good Evening,
    i want to get the value from the check box.
    for this i wrote like this
    OAMessageCheckBoxBean cbb=(OAMessageCheckBoxBean)webBEan.findChildRecurssive("item240")
    String val=cbb.getvalue(pageContext).toString();
    val getting the value only when checkbox is checked.
    suppose check box is not checked that time i got NULL POINTER exceptionn.
    so
    i tried the following way alsoo
    string val=pageContext.getParameter("item240");
    here val return 'on' only when checkbox is checked.
    otherwise NULL value returnss.
    but i want to get the value is 'Y' when i am checked the checkbox
    otherwise returns NULL valuee.
    already i set the checkbox properties alsoo
    Checked :Y
    unchecked:N
    pls tell me

    Hi,
    use
    try
    OAMessageCheckBoxBean cbb=(OAMessageCheckBoxBean)webBEan.findChildRecurssive("item240")
    String test = cbb.getvalue(pageContext).toString();
    catch(Exception e)
    String test = "";
    this way you can handle null pointer exception.
    Thanks,
    Gaurav

  • Returning a string from one class to another

    I have a file from where i creating an object of another class and calling the fuctionsl
    This is how i am doing
    public login()
    String input =new String (passwordField.getPassword());
         input= input.trim();
    tempuser= userField.getText();
              db2sqln patientsqln =new db2sqln(); //creating an object
              patientsqln.connectdb2();// calling a connect to database function
              patientsqln.dbselect(tempuser);// passing the login informaiont
    in patientsqln i am getting the password from the database and want to pass it back to login class so that i can compare the entered password and the database password
    here is i am using my patientsqln.dbselect()
    //public void dbselect(String userinput)
              try
              Statement stmt = con.createStatement();
              String select = "Select patientpass from patient where PATIENTUSER="+"'"+userinput+"'";
              ResultSet rs = stmt.executeQuery(select);
              while (rs.next())
              name=rs.getString("PATIENTPASS");
              name = name.trim();
              System.out.println(name+"from db2sqln");
              rs.close();
    My question is that everything else works fine, but i donot get any password back in login() class it returns null value. looks like i am not returing the string back. how should i do that
    I am comparing like this
    if(input.equals("name"))
    System.out.println("Correct password");
    else{
    System.out.println("Incorrect password");
    //

    I have a file from where i creating an object of another class and calling the fuctionsl
    This is how i am doing
    public login()
    String input =new String (passwordField.getPassword());
    input= input.trim();
    tempuser= userField.getText();
    db2sqln patientsqln =new db2sqln(); //creating an object
    patientsqln.connectdb2();// calling a connect to database function
    patientsqln.dbselect(tempuser);// passing the login informaiont
    in patientsqln i am getting the password from the database and want to pass it back to login class so that i can compare the entered password and the database password
    here is i am using my patientsqln.dbselect()
    //public void dbselect(String userinput)
    try
    Statement stmt = con.createStatement();
    String select = "Select patientpass from patient where PATIENTUSER="+"'"+userinput+"'";
    ResultSet rs = stmt.executeQuery(select);
    while (rs.next())
    name=rs.getString("PATIENTPASS");
    name = name.trim();
    System.out.println(name+"from db2sqln");
    rs.close();
    My question is that everything else works fine, but i donot get any password back in login() class it returns null value. looks like i am not returing the string back. how should i do that
    I am comparing like this
    if(input.equals("name"))
    System.out.println("Correct password");
    else{
    System.out.println("Incorrect password");
    //

Maybe you are looking for

  • Help with OSS Note Quality

    Hi, I'm trying to review OSS Notes and I find a lot of notes that I feel don't have enough context to basically understand what the note is about.  Basically I feel the Note Quality is poor.  I found this one just today.  Could someone look at it and

  • Material Number prefix Isuue

    Hi Friends, In my SAP system we are using number range for material is as 12 CHAR. so we have created all materials with 12 no char only. We are this system for the past 3 yrs. Now all of a sudden my system is not accepting 12 CHAR material numbers,

  • Cascading LOV in 11.1.2.1 gives me an ArrayIndexOutOfBoundsException

    I am using JDeveloper 11.1.2.1 and was following the tutorial in the following YouTube video: http://www.youtube.com/watch?v=nXwL2_RP7AQ&feature=player_embedded#! It looks to have been for an older version of JDeveloper, so I then followed the text i

  • IPhone5 stuck in recovery mode during iOS7.0.6 update - no way to secure media?!

    Hi Apple, I have run your recent iOS7.0.6 update on my iPhone5 and it got stuck in the Apple logo + progress bar screen (N.B. I had no problems updating an iPadAir and iPhone4). To get it out of the update infinite loop (no pun intended!) I put it in

  • TS4268 I keep getting a message waiting for activation when I turn on IMessage

    I am trying to activate my IMessage and it keeps saying waiting activation but is doing nothing.  Also, Send & Receive doesn't show my phone #