我是 sqlite 的初学者,我使用它我别无选择,我用 java 编码,我有一个请求,它应该作为 reslutat 两列返回,但它返回任何东西,结果集是 org.sqlite.RS@..,请我需要这方面的帮助,提前谢谢你。
public List<String> executeSelect( String ArgRequete, boolean All) throws SQLException
{
String ReturnColumn = ArgRequete.substring( ArgRequete.indexOf( "SELECT" )+ 6, ArgRequete.indexOf( "FROM" ) ).replaceAll(" ","");
List<String> Str = new ArrayList<String>();
logger.info("ret :"+ReturnColumn);
String[] columns=ReturnColumn.split(",");
for(String ico:columns){
logger.info(ico);
}
stmt = con.createStatement();
rs = stmt.executeQuery( ArgRequete );
logger.info(ArgRequete);
logger.info("mon resultSet:"+rs);
if ( !All )
{
if ( rs.next() )
{
String result = "";
for(String aColumn : columns){
result += rs.getString(aColumn ) + ",";
logger.info(result);
}
Str.add( result );
}
}
while ( rs.next() && All )
{
String result = "";
for(String aColumn : columns){
result += rs.getString( aColumn ) + ",";
}
Str.add( result );
}
stmt.close();
return Str;
}
public void etapeParametrerOption(String login) throws IOException, SQLException
{
assertTrue( "Texte 'Paramétrer les options' non présent, voir code source HTML dans LogOut",selenium.isTextPresent( "Paramétrer les options" ) );
String [] tab=LogFile.showWSEtAppelCOffrEFrom(login);
List<String>ls=new ArrayList<String>();
for(String itab : tab){
ls=dbCOffrE.executeSelect("SELECT busitypid,attblabel FROM t_article art, t_attribute att , t_srvbrick_attr_article srv WHERE att.attbid = srv.attbid and art.artid = srv.artid and att.modoptidmodifiable = '2' and (att.attbinactivationdate is null or att.attbinactivationdate < date('now')) and art.artshortlabel='"+itab+"'",false); logger.info("ma liste :"+ls);
}}
我的文件日志包含什么
INFO [com.sfr.price.functionalTest.commons.SQLBase.executeSelect](82) [] ret :busitypid,attblabel
INFO [com.sfr.price.functionalTest.commons.SQLBase.executeSelect](85) [] busitypid
INFO [com.sfr.price.functionalTest.commons.SQLBase.executeSelect](85) [] attblabel
INFO [com.sfr.price.functionalTest.commons.SQLBase.executeSelect](90) [] SELECT busitypid,attblabel FROM t_article art, t_attribute att , t_srvbrick_attr_article srv WHERE att.attbid = srv.attbid and art.artid = srv.artid and att.modoptidmodifiable = '2' and art.artshortlabel='8001P'
INFO [com.sfr.price.functionalTest.commons.SQLBase.executeSelect](93) [] mon resultSet:org.sqlite.RS@24c672
INFO [com.sfr.price.functionalTest.scenario.impl.AJLINGE.etapeParametrerOption](799) [] ma liste :[]