Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • TANGOARCH-936
  • master
  • hdbtdbArchivingApi-2.3.10
  • hdbtdbArchivingApi-2.3.3
  • hdbtdbArchivingApi-2.3.4
  • hdbtdbArchivingApi-2.3.5
  • hdbtdbArchivingApi-2.3.6
  • hdbtdbArchivingApi-2.3.7
  • hdbtdbArchivingApi-2.3.8
  • hdbtdbArchivingApi-2.3.9
  • hdbtdbArchivingApi-2.4.0
  • hdbtdbArchivingApi-2.4.1
  • hdbtdbArchivingApi-2.4.10
  • hdbtdbArchivingApi-2.4.11
  • hdbtdbArchivingApi-2.4.12
  • hdbtdbArchivingApi-2.4.13
  • hdbtdbArchivingApi-2.4.14
  • hdbtdbArchivingApi-2.4.15
  • hdbtdbArchivingApi-2.4.2
  • hdbtdbArchivingApi-2.4.3
  • hdbtdbArchivingApi-2.4.4
  • hdbtdbArchivingApi-2.4.5
  • hdbtdbArchivingApi-2.4.6
  • hdbtdbArchivingApi-2.4.7
  • hdbtdbArchivingApi-2.4.8
  • hdbtdbArchivingApi-2.4.9
  • hdbtdbArchivingApi-2.5.0
  • hdbtdbArchivingApi-2.5.1
  • hdbtdbArchivingApi-2.5.10
  • hdbtdbArchivingApi-2.5.11
  • hdbtdbArchivingApi-2.5.12
  • hdbtdbArchivingApi-2.5.2
  • hdbtdbArchivingApi-2.5.3
  • hdbtdbArchivingApi-2.5.4
  • hdbtdbArchivingApi-2.5.5
  • hdbtdbArchivingApi-2.5.6
  • hdbtdbArchivingApi-2.5.7
  • hdbtdbArchivingApi-2.5.8
  • hdbtdbArchivingApi-2.5.9
  • release_2_2_10
  • release_2_2_11
  • release_2_2_12
  • release_2_2_13
  • release_2_2_14
  • release_2_2_15
  • release_2_2_16
  • release_2_2_17
  • release_2_2_18
  • release_2_3_0
  • release_2_3_1
  • release_2_3_10
  • release_2_3_2
  • release_2_3_7
  • trunk
54 results

Target

Select target project
No results found
Select Git revision
  • TANGOARCH-936
  • master
  • hdbtdbArchivingApi-2.3.10
  • hdbtdbArchivingApi-2.3.3
  • hdbtdbArchivingApi-2.3.4
  • hdbtdbArchivingApi-2.3.5
  • hdbtdbArchivingApi-2.3.6
  • hdbtdbArchivingApi-2.3.7
  • hdbtdbArchivingApi-2.3.8
  • hdbtdbArchivingApi-2.3.9
  • hdbtdbArchivingApi-2.4.0
  • hdbtdbArchivingApi-2.4.1
  • hdbtdbArchivingApi-2.4.10
  • hdbtdbArchivingApi-2.4.11
  • hdbtdbArchivingApi-2.4.12
  • hdbtdbArchivingApi-2.4.13
  • hdbtdbArchivingApi-2.4.14
  • hdbtdbArchivingApi-2.4.15
  • hdbtdbArchivingApi-2.4.2
  • hdbtdbArchivingApi-2.4.3
  • hdbtdbArchivingApi-2.4.4
  • hdbtdbArchivingApi-2.4.5
  • hdbtdbArchivingApi-2.4.6
  • hdbtdbArchivingApi-2.4.7
  • hdbtdbArchivingApi-2.4.8
  • hdbtdbArchivingApi-2.4.9
  • hdbtdbArchivingApi-2.5.0
  • hdbtdbArchivingApi-2.5.1
  • hdbtdbArchivingApi-2.5.10
  • hdbtdbArchivingApi-2.5.11
  • hdbtdbArchivingApi-2.5.12
  • hdbtdbArchivingApi-2.5.2
  • hdbtdbArchivingApi-2.5.3
  • hdbtdbArchivingApi-2.5.4
  • hdbtdbArchivingApi-2.5.5
  • hdbtdbArchivingApi-2.5.6
  • hdbtdbArchivingApi-2.5.7
  • hdbtdbArchivingApi-2.5.8
  • hdbtdbArchivingApi-2.5.9
  • release_2_2_10
  • release_2_2_11
  • release_2_2_12
  • release_2_2_13
  • release_2_2_14
  • release_2_2_15
  • release_2_2_16
  • release_2_2_17
  • release_2_2_18
  • release_2_3_0
  • release_2_3_1
  • release_2_3_10
  • release_2_3_2
  • release_2_3_7
  • trunk
54 results
Show changes

Commits on Source 2

1 file
+ 52
48
Compare changes
  • Side-by-side
  • Inline

Files

Original line number Diff line number Diff line
package fr.soleil.archiving.hdbtdb.api.management.attributes.extractor;

import java.lang.reflect.Array;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import fr.esrf.Tango.AttrWriteType;
import fr.esrf.Tango.ErrSeverity;
import fr.esrf.TangoDs.TangoConst;
@@ -26,11 +18,19 @@ import fr.soleil.database.DBExtractionConst;
import fr.soleil.database.connection.AbstractDataBaseConnector;
import fr.soleil.lib.project.math.MathConst;

import java.lang.reflect.Array;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

public abstract class GenericExtractorMethods implements DBExtractionConst {

    protected final AbstractDataBaseConnector connector;
    private volatile Statement lastStatement;
    private volatile boolean canceled;
    protected final AbstractDataBaseConnector connector;

    public GenericExtractorMethods(final AbstractDataBaseConnector connector) {
        lastStatement = null;
@@ -38,19 +38,6 @@ public abstract class GenericExtractorMethods implements DBExtractionConst {
        this.connector = connector;
    }

    public boolean isCanceled() {
        return canceled;
    }

    public void setCanceled(final boolean canceled) throws ArchivingException {
        this.canceled = canceled;
        if (canceled) {
            if (canceled) {
                ConnectionCommands.cancelStatement(lastStatement);
            }
        }
    }

    public void makeDataException(final int format, final String type1, final String type2) throws ArchivingException {
        String message = "", reason = "", desc = "";
        message = "Failed retrieving data ! ";
@@ -107,6 +94,19 @@ public abstract class GenericExtractorMethods implements DBExtractionConst {
        return valuesCount;
    }

    public boolean isCanceled() {
        return canceled;
    }

    public void setCanceled(final boolean canceled) throws ArchivingException {
        this.canceled = canceled;
        if (canceled) {
            if (canceled) {
                ConnectionCommands.cancelStatement(lastStatement);
            }
        }
    }

    public DbData[] getAttScalarDataForQuery(final String query, final DbData... dbData) throws ArchivingException {
        DbData[] result;
        Connection conn = null;
@@ -139,27 +139,6 @@ public abstract class GenericExtractorMethods implements DBExtractionConst {
        return result;
    }

    private Object extractData(ResultSet rset, int index, int dataType, boolean... nullElements) throws SQLException {
        Object value;
        if (dataType == TangoConst.Tango_DEV_STRING) {
            value = rset.getString(index);
            if (rset.wasNull()) {
                nullElements[0] = true;
            } else {
                value = StringFormater.formatStringToRead((String) value);
            }
        } else {
            value = rset.getDouble(index);
            if (rset.wasNull()) {
                nullElements[0] = true;
                value = DbUtils.cast(dataType, MathConst.NAN_FOR_NULL);
            } else {
                value = DbUtils.cast(dataType, (double) value);
            }
        }
        return value;
    }

    public void treatStatementResultForGetScalarData(ResultSet rset, DbData... result)
            throws SQLException, ArchivingException {
        if ((rset != null) && (result != null) && (result.length == 2)
@@ -207,6 +186,32 @@ public abstract class GenericExtractorMethods implements DBExtractionConst {
        }
    }

    private Object extractData(ResultSet rset, int index, int dataType, boolean... nullElements) throws SQLException {
        Object value;
        if (dataType == TangoConst.Tango_DEV_STRING) {
            value = rset.getString(index);
            if (rset.wasNull()) {
                nullElements[0] = true;
            } else {
                value = StringFormater.formatStringToRead((String) value);
            }
        } else if (dataType == TangoConst.Tango_DEV_BOOLEAN) {
            value = rset.getBoolean(index);
            if (rset.wasNull()) {
                nullElements[0] = true;
            }
        } else {
            value = rset.getDouble(index);
            if (rset.wasNull()) {
                nullElements[0] = true;
                value = DbUtils.cast(dataType, MathConst.NAN_FOR_NULL);
            } else {
                value = DbUtils.cast(dataType, (double) value);
            }
        }
        return value;
    }

    public abstract DbData[] treatStatementResultForGetSpectData(ResultSet rset, final String attributeName,
                                                                 DbData... dbData) throws ArchivingException;

@@ -436,8 +441,7 @@ public abstract class GenericExtractorMethods implements DBExtractionConst {
     * <b>Description : </b> Creates the table of an image read/write type
     * attribute <I>(mySQL only)</I>.
     *
     * @param attributeID
     *            The ID of the associated attribute
     * @param attributeID The ID of the associated attribute
     */
    public void buildAttributeImageTab(final String attributeID, final String[] tab, final int dataType)
            throws ArchivingException {