我收到错误 - 我的SQL查询是否正在执行? - 我在这里试图获得QS_SIZE - 我认为我做错了什么?

时间:2017-01-29 03:27:19

标签: java sql

private void populateSizeById(String Id) {
    String method = ".populateSizeById() "; //Is this method incorrect?
    enter code here

    PreparedStatement preparedStatement = null;
    String Size = ""; //Assigning Size
    try {
          preparedStatement = super.prepareStatement(GET_SIZE_BY_ID,                   ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 
//assign sql -- thinking sql query is not executing.. 
        super.setString(1, Id, preparedStatement); // ????????
        ResultSet resultSet = super.executeQuery(preparedStatement); // ID
        while (ResultSetHelper.next(resultSet)) {

            Size = ResultSetHelper.getString(resultSet, "FS_SIZE"); //FS_SIZE
            if (null != Size && !"".equals(Size)) super.setFieldValue("QS_SIZE",     Size); // QS_SIZE ERROR here.. Doesnt get the value here.. Size is turning into null               
        }
    } catch(MaximumResultsExceededException mreEx) {
        throw new CivSQLException(TRACE_TAG + method, mreEx);
    } finally {
        super.cleanup(preparedStatement);
    }

    } //What wrong am I doing..

     private final static String GET_SIZE_BY_ID = " SELECT F.FS_SIZE  " + " FROM       TABLE F  " + "   WHERE F.ID = ? "; // SQL query to run

我试图通过执行SQL查询来获取QS_SIZE的大小值。你觉得我做错了什么?请帮助,我仍然是一个学习者,并试图了解....

0 个答案:

没有答案