Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

List not getting filled with data from database

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy everyone,

this is my first time writing on a forum. I hope I will be able to explain everything correctly.
So after hours of work I am still not getting my program to work. I am creating a GUI which if empty gives all data from database or if you enter last name it gives you last name and other data from that employee. I have already a database with data, now I am trying to connect to it, store the data in a list and then show it in a JTable.
my tableModel class

my class for connecting to DB and storing data to a list

and my gui


I hope there is someone who can give me some kind of a hint or solution of what I am doing wrong.

Thank you
 
Saloon Keeper
Posts: 7171
65
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't make sense. You are adding a list's elements to itself. You are not returning anything or setting any external list.
 
Anna Lunes
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i thought to store the list from another class ant then call it in GUI class.. havent thought about trying to do it other way. Thanks I will try to fix it that way  
 
No holds barred. And no bars holed. Except this tiny ad:
Try Free Java/.NET Libraries for Word Excel PowerPoint and PDF
htttp://www.e-iceblue.com/free-apis.html
    Bookmark Topic Watch Topic
  • New Topic