请问怎样编写返回对mysql数据库有auto_increment字段表刚完成insert命令所自动产生的id值?我用的是jsp,谢谢!

解决方案 »

  1.   

    public class T1109 {
        public static void main(String args[]){
            System.out.println(System.getProperty("user.dir")+"\\src\\"+T1109.class.getName().replaceAll("\\.","\\\\"));
        }
    }
      

  2.   

    SQL SERVER中有@@identity可以直接取得.
      

  3.   

    可我用的是mysql,不知在mysql是怎么取得,第一次用mysql所以不太清楚er
      

  4.   

    You can retrieve the most recent AUTO_INCREMENT value with the LAST_INSERT_ID() SQL function want to know more
    mysql document
    http://dev.mysql.com/doc/refman/5.1/en/example-auto-increment.html
      

  5.   

    thank qiyadeng(more in sorrow than in anger)!