java - sub query result not successful -


i have problem in sub query in sqlite query result. when executing below query returns result in sqlite database when running program not returns value. i’m doing wrong in below program. please advice.

query:

select * (select count(*), col2,col9,col4 tbl_data_1  col4=6  , col3 between '2012-11-21' , '2013-04-19' group col2,col9,col4) inr_qry col2= '20016' , col9='3' 

program in java:

vector<vector> datalist = new vector(); (int =0; < listrows.size(); i++){     vector cols = new vector();                  cols.add(listrows.get(i));     (int j = 1; j < listcolumns.size(); j++){         // below query dynamic         string inner_query = "select * (select count(*), col2,col9,col4 tbl_data_1  col4=6  , col3 between '2012-11-21'               , '2013-04-19' group col2,col9,col4) inr_qry col2= '20016' , col9='3'";          preparedstatement data_st = database.getconnection().preparestatement(inner_query);         resultset data_rs = data_st.executequery();         while (data_rs.next())  { // result not successful, result set not having records             slogger.printd("data_rs.getstring(1): " +data_rs.getstring(1));             cols.add(data_rs.getstring(1));         }     }     datalist.add(cols); } 

you dont need preparedstatement. instead use this:

statement stmt = database.getconnection().createstatement(); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -