public class T1109 { public static void main(String args[]){ System.out.println(System.getProperty("user.dir")+"\\src\\"+T1109.class.getName().replaceAll("\\.","\\\\")); } }
SQL SERVER中有@@identity可以直接取得.
可我用的是mysql,不知在mysql是怎么取得,第一次用mysql所以不太清楚er
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
public static void main(String args[]){
System.out.println(System.getProperty("user.dir")+"\\src\\"+T1109.class.getName().replaceAll("\\.","\\\\"));
}
}
mysql document
http://dev.mysql.com/doc/refman/5.1/en/example-auto-increment.html