Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ResultSet rs = statment.executeQuery(); table.setModel(DbUtils.resultSetToTableModel(rs));
我认为您无法设置从数据库中选择的列名,但您可以将数据从该列复制到新列中并设置该新列的名称。
否则,您可以使用此代码获取该列名称.. :)
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2"); ResultSetMetaData rsmd = rs.getMetaData(); String name = rsmd.getColumnName(1);
1列的索引在哪里。
1