【发布时间】:2012-12-19 16:32:33
【问题描述】:
我正在尝试获取 mysql_insert_id() 之类的 mysql 命令;它检索最后插入的行的 auto_increment id。我该怎么做才能在 Java 中获得它?
rs = st.executeQuery("select last_insert_id() from schedule");
lastid = rs.getString("last_insert_id()");
我的 lastid 被声明为 INT。我不知道在 rs.get 中使用什么以及参数..
【问题讨论】: