Results 1 to 6 of 6
  1. #1
    raj reddy is offline Member
    Join Date
    Apr 2008
    Posts
    31
    Rep Power
    0

    Default how to Parse int to a string variable (pls hlp)

    Hi


    while(rs.next()) {

    String Fname = Integer.parseInt(rs.getInt("tktkey"));


    }


    am getting this type of error


    cannot find symbol

    symbol:methodparseInt(Int)

  2. #2
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    8

    Default

    Try this...

    Java Code:
    String Fname = Integer.toString(rs.getInt("tktkey"));
    Did this post help you? Please me! :cool:

  3. #3
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default

    Your method parseInt takes a String and converts it into an integer. This is the opposite of what you need which is what Don showed.

  4. #4
    gogoc is offline Member
    Join Date
    May 2008
    Posts
    21
    Rep Power
    0

    Default

    you can straight away assign your integer to string just add +"" with the integer

  5. #5
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    6

    Default

    yeah just to what gogoc said just do "" + you integer.
    My IP address is 127.0.0.1

  6. #6
    Join Date
    Jun 2008
    Location
    Delhi, India
    Posts
    6
    Rep Power
    0

Similar Threads

  1. Replies: 4
    Last Post: 02-22-2009, 04:31 PM
  2. how to Parse int to a string variable
    By raj reddy in forum Java Servlet
    Replies: 10
    Last Post: 01-09-2009, 07:41 PM
  3. How to parse String effectively based on a dilimiter
    By raghu408 in forum Advanced Java
    Replies: 26
    Last Post: 04-10-2008, 10:55 PM
  4. Replies: 1
    Last Post: 08-03-2007, 10:52 AM
  5. String Variable
    By Eric in forum Advanced Java
    Replies: 1
    Last Post: 06-06-2007, 04:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •