在尝试进行数据库调用时,我收到以下错误,如果有人遇到这个并解决了?
Caused by: javax.sql.rowset.spi.SyncFactoryException: Resource javax/sql/rowset/rowset.properties not found
at javax.sql.rowset.spi.SyncFactory.lambda$initMapIfNecessary$0(SyncFactory.java:393)
at java.security.AccessController.doPrivileged(Native Method)
at javax.sql.rowset.spi.SyncFactory.initMapIfNecessary(SyncFactory.java:388)
at javax.sql.rowset.spi.SyncFactory.getInstance(SyncFactory.java:557)
at com.sun.rowset.CachedRowSetImpl.<init>(CachedRowSetImpl.java:361)
at com.sun.rowset.RowSetFactoryImpl.createCachedRowSet(RowSetFactoryImpl.java:49)
添加代码段,
private CachedRowSet getRowSet(ResultSet resultSet) throws SQLException {
CachedRowSet results = RowSetProvider.newFactory().createCachedRowSet();
results.populate(resultSet);
return results;
}
我不知道为什么,但是调用CachedRowSet可以明确解决问题。任何正确的答案将不胜感激。
public void setDataSource(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
Class<CachedRowSet> doNOTdelete = CachedRowSet.class;
load();
}