🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #549

Re: Retrieve int data from a table

#549
From: Pep
Date: Mon, 20 Jun 2005 10:01
63 lines
2679 bytes
Great.
Thanks
"Tony" <aoganesi_a^t_yahoo_._com> escribi� en el mensaje 
news:42b4ae13$1@newsgroups.borland.com...
> Could it be someting trivial?
>
> int myVar = ((Integer)model.getValueAt(selectedRow, 3)).intValue();
>
> Tony.
>
> "Pep" <pep@yahoo.com> wrote in message 
> news:42b4aa37@newsgroups.borland.com...
>> Hello.
>>
>> I cast (or I try) to int
>> (int)model.getValueAt(selectedRow, 3)
>> and I've used (Integer)model.getValueAt(selectedRow, 3) too, but no way.
>>
>> The version I use is 1.4.2_06
>>
>> Any other suggestion?
>>
>> Thanks
>>
>>
>>
>>
>> "Alexey N. Solofnenko" <nospam@nospam.comp> escribi� en el mensaje 
>> news:42b480d7$1@newsgroups.borland.com...
>>> You will need to cast it to Integer first. Then depending on your Java 
>>> version, 5.0 Java itself can unbox Integer into int, or call intValue() 
>>> method.
>>>
>>> - Alexey.
>>>
>>> Pep wrote:
>>>> Hello.
>>>>
>>>> I have a problem retrieving the data from a table. When I select a row 
>>>> of data (which I retrieve
>>>> from a mysql database) one of the columns is an integer type and the 
>>>> others are varchar.
>>>>
>>>> I use the next --(String)model.getValueAt(selectedRow, 0)-- to take the 
>>>> value from the row selectedRow
>>>> and the column 0, and everything is ok.
>>>>
>>>> When  I try to retrieve the value of a column which store an int type 
>>>> (int in myql), I can't get
>>>> the value and I can't do the next:  (int)model.getValueAt(selectedRow, 
>>>> 3)
>>>>
>>>> How can I retrieve this value to store in an int variable????
>>>>
>>>> Thanks
>>>
>>> -- 
>>> Alexey N. Solofnenko
>>> home: http://trelony.cjb.net/
>>
>>
>
> 
Technical Details
Message-ID: <42b6943f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42b47cc9@newsgroups.borland.com> <42b480d7$1@newsgroups.borland.com> <42b4aa37@newsgroups.borland.com> <42b4ae13$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,a57dea76bd9691e
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII
From: "Pep" <pep@yahoo.com>
Newsgroups: borland.public.jbuilder.java.swing
References: <42b47cc9@newsgroups.borland.com> <42b480d7$1@newsgroups.borland.com> <42b4aa37@newsgroups.borland.com> <42b4ae13$1@newsgroups.borland.com>
Subject: Re: Retrieve int data from a table
Date: Mon, 20 Jun 2005 11:01:20 +0100
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 217.124.45.192
Message-ID: <42b6943f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1119261759 217.124.45.192 (20 Jun 2005 03:02:39 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail