net.anwiba.commons.swing.database.console.result.ReaultSetToRowConverter Maven / Gradle / Ivy
/*
* #%L
* *
* %%
* Copyright (C) 2007 - 2017 Andreas W. Bartels
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
package net.anwiba.commons.swing.database.console.result;
import java.io.IOException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import net.anwiba.commons.logging.ILevel;
import net.anwiba.commons.reference.utilities.IoUtilities;
public class ReaultSetToRowConverter {
private static net.anwiba.commons.logging.ILogger logger = net.anwiba.commons.logging.Logging
.getLogger(ReaultSetToRowConverter.class);
private final List readOrder = new ArrayList<>();
private final int count;
private final List types;
private final List typeNames;
public ReaultSetToRowConverter(final List types, final List typeNames, final int count) {
this.types = types;
this.typeNames = typeNames;
this.count = count;
for (int i = 0; i < this.count; i++) {
if (types.get(i) == -1
&& (Objects.equals(typeNames.get(i), "LONG") || Objects.equals(typeNames.get(i), "LONG RAW"))) { //$NON-NLS-1$ //$NON-NLS-2$
this.readOrder.add(0, i);
continue;
}
this.readOrder.add(i);
}
}
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy