problem caused by single quotes in select query

public void getExp(String bool_expression,int groupId,int expLevel){ List list=new ArrayList(); List nextExpressionList = new ArrayList(); try{ ResultSet resultSet=null; String sqlString = null; Statement stmt = null; if(expLevel==1){ System.out.println("explevel---"+expLevel+"group Id --"+groupId); sqlString ="select bool_expression from LNP_ENG_EXPRESSIONS where fk_group="+groupId+" and expression_level="+expLevel+""; stmt =connection.createStatement(); resultSet= stmt.executeQuery(sqlString); while({ nextExpressionList.add(resultSet.getString(1)); System.out.println("expression -- "+ resultSet.getString(1)); } } if(expLevel > 1 ){ System.out.println("bool_ expression --"+bool_expression); String sql = "select distinct variable_name from LNP_ENG_VARIABLES where id IN "+ "(select fk_variable_id from LNP_ENG_QUESTIONS where question_code IN "+ "( select Question_code from LNP_APP_QUESTIONS where id IN "+ "(select fk_question_id from LNP_ENG_ASC_QUESTION_EXP where FK_EXP_ID IN"+ "(select id from LNP_ENG_EXPRESSIONS where bool_expression = '"+bool_expression+"'"+"and fk_group="+groupId+" and expression_level="+(expLevel-1)+"))))"; System.out.println("1"); stmt =connection.createStatement(); resultSet=stmt.executeQuery(sql); while({ list.add(resultSet.getString(1)); System.out.println("list --"+resultSet.getString(1)); } for(int i=0;1

以上就是problem caused by single quotes in select query的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准