PreparedStatement stmt = connection.prepareStatement("SELECT " + SELECT_FIELDS + " FROM " + TABLE_NAME + " WHERE SDB_ID = ? ORDER BY DATE_TIME");
stmt.setString(1, stockDatabaseId);
List<IOHLCPoint> result = new LinkedList<IOHLCPoint>();
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
BarSize barSize = BarSize.valueOf(rs.getString(1));
Date date = new Date(rs.getTimestamp(2).getTime());
Double open = rs.getDouble(3);
Double high = rs.getDouble(4);
Double low = rs.getDouble(5);
Double close = rs.getDouble(6);