🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7339

Re: How do you convert an integer to a string?

#7339
From: Calvin R. Smith
Date: Wed, 27 Jun 2001 15:59
32 lines
1581 bytes
do this
String s = "06";
int i = (new Integer(s)).intValue();

<swett@starband.com> wrote in message news:3b3a02b6_2@dnews...
> I have a database table that has dates stored as numeric fields, such as:
>
> 20010625
> 20010626
> 20010627
>
> etc. (YYYYMMDD format)
>
> During/after reading these values, I'd like to break these into 3 integer
> fields:
>
> 2001 (year)
> 06 (month)
> 25 (day)
>
> How can that be done?
>
> I can read the field in from the result set with:
>
> resultset.getString("mycol");
>
> and then break it down into 3 string objects for year, month, and day; but
> how do I get these values into integer format?
>
> Thanks.
>
>
Technical Details
Message-ID: <3b3a0345$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b3a02b6_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,55667c966d6ea9fa
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-27 09:10:00 PST
From: "Calvin R. Smith" <calvinrsmith@hotmail.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b3a02b6_2@dnews>
Subject: Re: How do you convert an integer to a string?
Date: Wed, 27 Jun 2001 09:59:46 -0600
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 207.201.104.102
Message-ID: <3b3a0345$1_1@dnews>
X-Trace: dnews 993657669 207.201.104.102 (27 Jun 2001 09:01:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews