Article View: borland.public.jbuilder.java.swing
Article #544Re: Retrieve int data from a table
From: Alexey N. Solofnenko
Date: Sat, 18 Jun 2005 20:15
Date: Sat, 18 Jun 2005 20:15
31 lines
1847 bytes
1847 bytes
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:
<42b480d7$1@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.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42b47cc9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,a57dea76bd9691e X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sat, 18 Jun 2005 13:15:25 -0700 From: "Alexey N. Solofnenko" <nospam@nospam.comp> User-Agent: Mozilla Thunderbird 1.0+ (X11/20050618) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Retrieve int data from a table References: <42b47cc9@newsgroups.borland.com> In-Reply-To: <42b47cc9@newsgroups.borland.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.188.247.45 Message-ID: <42b480d7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1119125719 67.188.247.45 (18 Jun 2005 13:15:19 -0700) Lines: 31 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail