更新时间:2023-12-04 09:25:46
这是一个很糟糕的例子:
That is a poor example to use:
请查看表格从数据库示例代码:数据库表。此示例使用的Vector将根据ResultSet中找到的行数增长。
Instead check out the Table From Database Example
code found in Table From Database. This example uses Vectors which will grow depending on the number of rows found in the ResultSet.
我不知道如何添加行到JTable和数据库
I don't know how to add row to JTable and Database
你可以使用 addRow(.. 。)
DefaultTableModel
的方法,动态添加数据。阅读API或在论坛/网站上搜索使用addRow(...)方法的示例。
You can use the addRow(...)
method of the DefaultTableModel
to add data dynamically. Read the API or search the forum/web for examples that use the addRow(...) method.
对于数据库插入,您可以从教程开始 JDBC数据库访问。
For database inserts you can start with the tutorial on JDBC Database Access.