Skip to content

Commit

Permalink
LinkedList to ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvard Fonsell committed Nov 6, 2015
1 parent 43bbb08 commit 4a11221
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateTime;
Expand Down Expand Up @@ -47,9 +47,10 @@ private ColumnNamesExtractor() {

@Override
public List<String> extractData(ResultSet rs) throws SQLException, DataAccessException {
List<String> columnNames = new LinkedList<>();
ResultSetMetaData metadata = rs.getMetaData();
for (int col = 1; col <= metadata.getColumnCount(); col++) {
int columnCount = metadata.getColumnCount();
List<String> columnNames = new ArrayList<>(columnCount);
for (int col = 1; col <= columnCount; col++) {
columnNames.add(metadata.getColumnName(col));
}
return columnNames;
Expand Down

0 comments on commit 4a11221

Please sign in to comment.