我有一个名为Customer的bean,有40个属性。我使用java prepare语句将bean数据插入数据库,所以每次我必须写setString()或setInt()时,任何人都可以建议我如何最小化这个?表示Netbeans或Eclipse IDE中是否有任何快捷方式用于生成带有bean getter属性的预准备语句
int x = 0;
Connection con = null;
String query = "INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country) VALUES (?,?,?,?,?,?);
PreparedStatement ps = con.prepareStatement(query);
ps.setString(++x, person.custName());
.
.
.
.
.
40 times