私は sqlite の初心者です。私はそれを使用します。選択の余地がなく、Java でコーディングしています。2 列の結果として返すように要求がありますが、結果セットは 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 :[]