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的大小值。你觉得我做错了什么?请帮助,我仍然是一个学习者,并试图了解....