Good morning, everyone. I am having a problem displaying the data in the JTable once I have inserted the values into the database. After I press the submit button, only blank rows are inserted into the JTable. It seems the insert functionality is working but the problem is it is not displaying the data like it should. I am inserting data from JTextfields from a JDialog panel and the data should be displayed in the JTable of the main view of my software application. Here is the SQL Insert Query that will insert the values into the database and then be displayed in the JTable:
Here is the method which will be called upon once the submit button is clicked:
Here is the class that performs the insertion into the database:
Finally, here is the database code for the main view:
Could anybody help me with this problem? Any suggestions would be appreciate. Thank you and have a great day.
Insert newlines and // and "+" to break long lines going over edge of screen. CR[/edit]
Please add a line which prints the text of the query as you call the insert query, probably in the insert method you quoted.
Please print the appropriate table before and after, using the command-line to access the database rather than JDBC. That might help you see what is going on.
How are you setting up your query String? The code you commented out doesn't look as if it would work. It is worthwhile learning about the format method of the String class, which might enable you to create such a String more easily.
subject: Table data does not appear after inserting it to the JTable