我无法在QUERY执行程序中执行此嵌入式SQL语句

时间:2012-12-04 09:17:32

标签: java sql jdbc

当我将Select benefitid from tr_benefittype where fiscal = '1'子句放入MSSQL中的查询执行器时,它表示没有该列的列。我搜索数据库,发现benefitid表中确实没有名为tr_benefittype的列。在发送到数据库之前,此列名是否以某种方式更改?

这是JAVA代码;

            m_risks = new TRRiskSet();
            new TRRiskSQL().getRisks(m_con, m_risks, m_currObject.getClass().getName(), 
                    m_currObject.getKey(), new String[] {"riskflag = 'R'"});

            budSQL.getBudgets(m_con, m_budgets, m_currObject.getClass().getName(), m_currObject.getKey(), 
                                            new String[] {"currencyid = " + corpCurrencyID});
            benSQL.getBenefits(m_con, m_benefits, m_currObject.getClass().getName(), m_currObject.getKey(), 
                    new String[] {"currencyid = " + corpCurrencyID + 
                " and benefitid in (select benefitid from tr_benefittype where fiscal='1')"});
            resSQL.getResourceBudgets(m_con, m_resources, m_currObject.getClass().getName(), 
                                                            m_currObject.getKey(), null);

我真的只是想知道java代码在将它发送到数据库之前是否正在更改SQL Query,这样它确实没有调用明显的列,有利于“

0 个答案:

没有答案