1、jdbc 获得刚刚自动生成的主键http://www.iteye.com/topic/586175
2、查sequence,取得主键,再插入数据
2,用JDBC的getGeneratedKeys,返回的是Oracle 的rowid.
PreparedStatement sta = conn.prepareStatement("INSERT INTO TESTTABLE VALUES (TESTSEQ.NEXTVAL,'aaaa')",Statement.RETURN_GENERATED_KEYS);
sta.execute();
System.out.println(sta.getGeneratedKeys());
ResultSet rest = sta.getGeneratedKeys();
rest.next();
//oracle rowid
System.out.println(rest.getString(1));
System.out.println(rest.getObject(1).getClass().getName());