這裏我添加了我的代碼。當我嘗試讀取表的列表時,問題發生在try塊中。如何使用HibernateDaoSupport獲取數據庫中的表的列表?
數據庫是MySql
例外是:java.lang.IllegalArgumentException:要遍歷的節點不能爲null!
public class DBOptimizationDAO extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(DBOptimizationDAO.class);
public void optimizeAdapter(String year)
{
List<com.ecw.adapterservice.beans.TransactionInbound> transactionInboundList = null;
StringBuilder queries = new StringBuilder();
try {
transactionInboundList = (List<com.ecw.adapterservice.beans.TransactionInbound>)super.getHibernateTemplate().find("from TransactionInbound where inboundTimestamp < '" + year+ "-01-01'order by 1 desc limit 2");
// Check if archive table exist or not
List<Object> inboundObj = getHibernateTemplate().find("SHOW TABLES LIKE transaction_outbound");
List<Object> outboundObj = getHibernateTemplate().find("SHOW TABLES LIKE 'transaction_outbound_archive'");
try塊出現什麼問題? – Markus
java.lang.IllegalArgumentException:要遍歷的節點不能爲null! –
請將此信息添加到問題中,理想情況下包括堆棧跟蹤。 – Markus