Skip to content
Snippets Groups Projects
Commit c46aa7f9 authored by gwen-soleil's avatar gwen-soleil
Browse files

Fix conversion for short values.

parent 1e4bc4c0
No related branches found
No related tags found
No related merge requests found
package fr.soleil.archiving.snap.api.tools;
import java.sql.ResultSet;
import java.sql.SQLException;
import fr.esrf.TangoDs.TangoConst;
import fr.soleil.archiving.common.api.tools.StringFormater;
import fr.soleil.lib.project.math.MathConst;
import java.sql.ResultSet;
import java.sql.SQLException;
public class TangoJAVAUtils {
public static Object initPrimitiveArray(int dataType, int length) {
......@@ -114,21 +114,20 @@ public class TangoJAVAUtils {
return resultSet.getString(index);
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_CHAR:
return Byte.valueOf(resultSet.getByte(index));
return resultSet.getShort(index);
case TangoConst.Tango_DEV_LONG:
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_STATE:
return Integer.valueOf(resultSet.getInt(index));
case TangoConst.Tango_DEV_BOOLEAN:
return Boolean.valueOf(resultSet.getInt(index) != 0);
case TangoConst.Tango_DEV_SHORT:
case TangoConst.Tango_DEV_USHORT:
return Short.valueOf(resultSet.getShort(index));
return resultSet.getInt(index);
case TangoConst.Tango_DEV_BOOLEAN:
return resultSet.getInt(index) != 0;
case TangoConst.Tango_DEV_FLOAT:
return Float.valueOf(resultSet.getFloat(index));
return resultSet.getFloat(index);
case TangoConst.Tango_DEV_DOUBLE:
default:
return Double.valueOf(resultSet.getDouble(index));
return resultSet.getDouble(index);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment