MCPcopy Index your code
hub / github.com/apache/groovy / calculateKeys

Method calculateKeys

subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java:4975–4991  ·  view source on GitHub ↗
(ResultSet keys)

Source from the content-addressed store, hash-verified

4973 //-------------------------------------------------------------------------
4974
4975 private static List<List<Object>> calculateKeys(ResultSet keys) throws SQLException {
4976 // Prepare a list to contain the auto-generated column
4977 // values, and then fetch them from the statement.
4978 List<List<Object>> autoKeys = new ArrayList<>();
4979 int count = keys.getMetaData().getColumnCount();
4980
4981 // Copy the column values into a list of a list.
4982 while (keys.next()) {
4983 List<Object> rowKeys = new ArrayList<>(count);
4984 for (int i = 1; i <= count; i++) {
4985 rowKeys.add(keys.getObject(i));
4986 }
4987
4988 autoKeys.add(rowKeys);
4989 }
4990 return autoKeys;
4991 }
4992
4993 private Statement createStatement(Connection connection) throws SQLException {
4994 if (resultSetHoldability == -1) {

Callers 1

executeInsertMethod · 0.95

Calls 4

addMethod · 0.65
getObjectMethod · 0.65
getColumnCountMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected