0
是否有可能檢索AUTOINC場後,我執行我插入:如何獲得自動遞增執行SQLQuery.executeUpdate後()insert語句
String queryString = "insert into " + String.format("table%04d", id) +
"(sectionid, topicid, dc) values (" + entry.getSectionId() +
", " + entry.getTopicId() + ", " + entry.getDc() + ")";
SQLQuery query = session.createSQLQuery(queryString);
query.executeUpdate();
表有四個字段
eid - autoinc
sectionid - int
topicid - int
dc - int
請幫助我
請參閱http://stackoverflow.com/questions/621369/sql-insert-and-catch-the-id-auto-increment-value/1452145#1452145 –
如果我不知道數據庫將要運行什麼成爲 – serge