Article View: borland.public.jbuilder.java.swing
Article #546Re: Retrieve int data from a table
From: Tony
Date: Sat, 18 Jun 2005 23:28
Date: Sat, 18 Jun 2005 23:28
57 lines
2470 bytes
2470 bytes
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:
<42b4ae13$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42b47cc9@newsgroups.borland.com> <42b480d7$1@newsgroups.borland.com> <42b4aa37@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: "Tony" <aoganesi_a^t_yahoo_._com> Newsgroups: borland.public.jbuilder.java.swing References: <42b47cc9@newsgroups.borland.com> <42b480d7$1@newsgroups.borland.com> <42b4aa37@newsgroups.borland.com> Subject: Re: Retrieve int data from a table Date: Sat, 18 Jun 2005 16:28:25 -0700 Lines: 59 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 69.33.38.98 Message-ID: <42b4ae13$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1119137299 69.33.38.98 (18 Jun 2005 16:28:19 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail