I want to write a java program that acts as a user interface to a mysql database,the program should do the following:
1.connect to the database,show available tables in the database
2.display table data
3.modify table data (insert,edit,delete,sort) rows
I’ve tried to use JDBC only,but couldn’t figure out a way to put the table data in a multidimensional array
is there an API i should be using instead of just JDBC?
Blatent plug for votes: Here is an answer I gave to a similar question, concerning populating a
JTablefrom a JDBCResultSet. As Michael says, there are a lot of existing SQL clients so it’s definitely not worth building your own. However, if you want to populate aJTablewithResultSetdata for a reason other than writing your own SQL client from scratch then the linked answer may help.Essentially the two APIs you’ll need are JDBC and Swing (or an alternative such as SWT). I recommend reading back data from your
ResultSeton a thread other than Swing’s Event Dispatch thread; Otherwise your UI will lock up during large read operations.