Results 1 to 2 of 2
- 03-13-2012, 02:47 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 45
- Rep Power
- 0
write stuff from jTable to mySQL table
I got this jTable jazz in my project, I'm fetching stuff from a mySQL database and populating a bunch of jTables. Now I've found some examples how to use jTable events to track for cell changes and then update, but I'm looking for a less efficient but perhaps simpler to understand method of updating the database from the jTable data through a GUI button.
If I could get an example how to grab all of the data, even the non-changed data, and write it all to an example database, that would be sweet!
At this point I'm just unsure how do I go about getting everything from the jTable efficiently and as simply as possible :)
- 03-13-2012, 03:37 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: write stuff from jTable to mySQL table
Doing so is highly dependent upon your data model, and did you try search the net for example? What have you tried? If you just want to load data using a JButton, then write an ActionListener and get the data from the JTable (the API clearly lists several methods for doing so - including getValueAt) then update your database as appropriate using JDBC. Otherwise, while the listener approach may seem difficult, it is much more maintainable and better practice.
Similar Threads
-
insert to MySQL table
By asai in forum New To JavaReplies: 2Last Post: 02-19-2012, 01:56 PM -
How can i get MySQL database table into jTable of my application?
By asifzbaig in forum AWT / SwingReplies: 2Last Post: 05-09-2011, 06:55 PM -
update a change in a Jtable directly to the mysql table
By Muffel in forum JDBCReplies: 0Last Post: 02-21-2010, 11:51 AM -
Table, beginner stuff
By drwk in forum New To JavaReplies: 1Last Post: 01-24-2010, 07:19 PM -
Problem with jTable that is binded with a table in MySQL Database
By rajkenneth in forum NetBeansReplies: 0Last Post: 03-29-2008, 03:36 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks