Results 1 to 6 of 6
Thread: JList and mysql
- 03-27-2011, 07:16 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 51
- Rep Power
- 0
- 03-27-2011, 07:40 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
It's a two step process:
1) you submit your query and get a ResultSet back;
2) you populate your JList given the values in the ResultSet.
Set 2) usually is a while loop until you've fetched all the values you want from the Resultset. There is no magic fillMyJListFromADatabase( ... ) method.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-28-2011, 09:44 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 51
- Rep Power
- 0
thanks i just thought their might be such a method lol
anyway i have sorted the problem
thanks
- 03-28-2011, 11:01 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,459
- Rep Power
- 16
As part of 2 in Jos's list, you will be turning each row into an object of some class you have defined in your model that represents that returned data.
That will be what your List consists of.
So you'll return a List<MyClass>.
- 03-28-2011, 01:50 PM #5
Um, the question was about a badly capitalized JListSo you'll return a List<MyClass>
db
- 03-28-2011, 01:59 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,459
- Rep Power
- 16
Similar Threads
-
Link one JList to another JList
By mib1bee in forum AWT / SwingReplies: 1Last Post: 12-31-2010, 07:10 PM -
Link one JList to another JList
By mib1bee in forum Advanced JavaReplies: 1Last Post: 12-30-2010, 06:35 PM -
Link one JList to another JList
By mib1bee in forum New To JavaReplies: 1Last Post: 12-30-2010, 06:24 PM -
How to use a JList?
By glhansen in forum New To JavaReplies: 3Last Post: 03-24-2009, 10:27 AM -
MySQL/JDBC Mysql query output
By thelinuxguy in forum Advanced JavaReplies: 4Last Post: 02-13-2009, 01:57 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks