Considering the following program :
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class SimpleTest {
public static void main(String[] args) throws SQLException {
Connection con = DriverManager.getConnection("jdbc:h2:mem:.",
"sa",
"");
Statement stmt = con.createStatement();
stmt.execute("CREATE TABLE T(id INT AUTO_INCREMENT, v INT)");
stmt.execute("INSERT INTO T(v) VALUES (3)");
ResultSet rs = stmt.getGeneratedKeys();
System.out.println(rs.getMetaData().getColumnLabel(1));
System.out.println(rs.getMetaData().getColumnName(1));
}
}
The printed results is :
IDENTITY()
IDENTITY()
I was guessing it would be id for both. Am I wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---