Article View: borland.public.jbuilder.java.swing
Article #545Re: Retrieve int data from a table
From: Pep
Date: Sat, 18 Jun 2005 23:11
Date: Sat, 18 Jun 2005 23:11
46 lines
2198 bytes
2198 bytes
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:
<42b4aa37@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42b47cc9@newsgroups.borland.com> <42b480d7$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> Subject: Re: Retrieve int data from a table Date: Sun, 19 Jun 2005 00:11:59 +0100 Lines: 48 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.46.40 Message-ID: <42b4aa37@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1119136311 217.124.46.40 (18 Jun 2005 16:11:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail