-
jdbc resultset and jtable
i'm new to java from vb.
How to a diplay an jdbc resultset in a swing jtable?
-
Re: jdbc resultset and jtable
I'll assume you don't want updates to the JTable to propagate back to the
database (of course you can do that, but it's more complex).
Read the fields from each row of the result set and create a Vector from
them. You'll have one vector per row, add each of these vectors to a
containing vector (only one for the entire table). Then create a new
JTable(thatVector) and you can display the data.
Sun has a good tutorial on how to use JTables on their developer site. It's
worth reading.
PC2
David Branch <davidbr@optoneline.net> wrote in message
news:3a5fc665$1@news.devx.com...
>
> i'm new to java from vb.
>
> How to a diplay an jdbc resultset in a swing jtable?
-
Re: jdbc resultset and jtable
thnaks
"Paul Clapham" <pclapham@core-mark.com> wrote:
>I'll assume you don't want updates to the JTable to propagate back to the
>database (of course you can do that, but it's more complex).
>
>Read the fields from each row of the result set and create a Vector from
>them. You'll have one vector per row, add each of these vectors to a
>containing vector (only one for the entire table). Then create a new
>JTable(thatVector) and you can display the data.
>
>Sun has a good tutorial on how to use JTables on their developer site.
It's
>worth reading.
>
>PC2
>
>David Branch <davidbr@optoneline.net> wrote in message
>news:3a5fc665$1@news.devx.com...
>>
>> i'm new to java from vb.
>>
>> How to a diplay an jdbc resultset in a swing jtable?
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks