public Vector execCmd(String path,String dbname,String filename)
{
/ar s='c';
Vector vc=new Vector();
//String opencmd=path+"test//imgserseek.exe opendb test.db";
String cmd=path+"ftp//imgserseek.exe opendb "+path+"ftp//"+dbname+".db queryImage "+path+filename+" closedb";
//System.out.println("cmd:"+cmd);
System.out.println(cmd);
try {
Runtime rt = Runtime.getRuntime();
Process proc=null;
proc = rt.exec(cmd);
InputStream is=proc.getInputStream();
InputStreamReader bis=new InputStreamReader(is);
BufferedReader br=new BufferedReader(bis);
System.out.println(br.readLine());
while(br!=null)
{
//String str=br.readLine();
String str=br.readLine();
//System.out.println("str:"+str);
if(str!=null)
{
String mistr=str.replaceAll(" ","");
if(!mistr.equals("Imagedatabaseclosed."))
{
String[] st=str.split(",");
//System.out.println("str:"+str.length());
String idstr=st[1].replaceAll(" ","");
//float similar=Float.parseFloat(st[1]);
HB_resultinfo hb_r=new HB_resultinfo();
//System.out.println(idstr);
ResultTab ret=hb_r.getOneResultinfo(Integer.parseInt(idstr));
//System.out.println(ret.getResultId());
/*CompareResult cr=new CompareResult();
if(ret!=null)
{
//cr.setColltime(ret.getCollTime());
if(ret.getDomainName()!=null)
{
cr.setDomainname(ret.getDomainName());
}
if(ret.getFileType()!=null)
{
cr.setFiletype(ret.getFileType());
cr.setIcn(ret.getIcn());
}
if(ret.getIcp()!=null)
{
cr.setIcp(ret.getIcp());
}
if(ret.getIpaddr()!=null)
{
cr.setIpaddr(ret.getIpaddr());
}
if(ret.getIpwhere()!=null)
{
cr.setIpwhere(ret.getIpwhere());
}
if(ret.getKeyTab().getKeyId()!=null)
{
cr.setKeyid(ret.getKeyTab().getKeyId());
}
if(ret.getKeyword()!=null)
{
cr.setKeyword(ret.getKeyword());
}
if(ret.getLinkurl()!=null)
{
cr.setLinkurl(ret.getLinkurl());
}
if(ret.getLinkwise()!=null)
{
cr.setLinkwise(ret.getLinkwise());
}
if(ret.getLocalLink()!=null)
{
cr.setLocallink(ret.getLocalLink());
}
if(ret.getMiniType()!=null)
{
cr.setMinitype(ret.getMiniType());
}
if(ret.getPowerValue()!=null)
{
cr.setPowervalue(ret.getPowerValue());
}
if(ret.getResultId()!=null)
{
cr.setResultid(ret.getResultId());
}
//cr.setSimilar(similar);
if(ret.getUserName()!=null)
{
cr.setUsername(ret.getUserName());
}
if(ret.getValidity()!=null)
{
cr.setValidity(ret.getValidity());
}
if(ret.getUpdaTime()!=null)
{
cr.setUpdatime(ret.getUpdaTime());
}
if(ret.getWebDepict()!=null)
{
cr.setWebdepict(ret.getWebDepict());
}
if(ret.getWebTittle()!=null)
{
cr.setWebtittle(ret.getWebTittle());
}
if(ret.getWeburl()!=null)
{
cr.setWeburl(ret.getWeburl());
}*/
if(ret!=null)
{
vc.add(ret);
}
// }
}
else
{
break;
}
}
else
{
break;
}
}
//proc = rt.exec(path+"test//imgserseek.exe closedb");
//s=bis.readChar();
} catch (Exception ex) {
ex.printStackTrace();
}
return vc;
}
{
/ar s='c';
Vector vc=new Vector();
//String opencmd=path+"test//imgserseek.exe opendb test.db";
String cmd=path+"ftp//imgserseek.exe opendb "+path+"ftp//"+dbname+".db queryImage "+path+filename+" closedb";
//System.out.println("cmd:"+cmd);
System.out.println(cmd);
try {
Runtime rt = Runtime.getRuntime();
Process proc=null;
proc = rt.exec(cmd);
InputStream is=proc.getInputStream();
InputStreamReader bis=new InputStreamReader(is);
BufferedReader br=new BufferedReader(bis);
System.out.println(br.readLine());
while(br!=null)
{
//String str=br.readLine();
String str=br.readLine();
//System.out.println("str:"+str);
if(str!=null)
{
String mistr=str.replaceAll(" ","");
if(!mistr.equals("Imagedatabaseclosed."))
{
String[] st=str.split(",");
//System.out.println("str:"+str.length());
String idstr=st[1].replaceAll(" ","");
//float similar=Float.parseFloat(st[1]);
HB_resultinfo hb_r=new HB_resultinfo();
//System.out.println(idstr);
ResultTab ret=hb_r.getOneResultinfo(Integer.parseInt(idstr));
//System.out.println(ret.getResultId());
/*CompareResult cr=new CompareResult();
if(ret!=null)
{
//cr.setColltime(ret.getCollTime());
if(ret.getDomainName()!=null)
{
cr.setDomainname(ret.getDomainName());
}
if(ret.getFileType()!=null)
{
cr.setFiletype(ret.getFileType());
cr.setIcn(ret.getIcn());
}
if(ret.getIcp()!=null)
{
cr.setIcp(ret.getIcp());
}
if(ret.getIpaddr()!=null)
{
cr.setIpaddr(ret.getIpaddr());
}
if(ret.getIpwhere()!=null)
{
cr.setIpwhere(ret.getIpwhere());
}
if(ret.getKeyTab().getKeyId()!=null)
{
cr.setKeyid(ret.getKeyTab().getKeyId());
}
if(ret.getKeyword()!=null)
{
cr.setKeyword(ret.getKeyword());
}
if(ret.getLinkurl()!=null)
{
cr.setLinkurl(ret.getLinkurl());
}
if(ret.getLinkwise()!=null)
{
cr.setLinkwise(ret.getLinkwise());
}
if(ret.getLocalLink()!=null)
{
cr.setLocallink(ret.getLocalLink());
}
if(ret.getMiniType()!=null)
{
cr.setMinitype(ret.getMiniType());
}
if(ret.getPowerValue()!=null)
{
cr.setPowervalue(ret.getPowerValue());
}
if(ret.getResultId()!=null)
{
cr.setResultid(ret.getResultId());
}
//cr.setSimilar(similar);
if(ret.getUserName()!=null)
{
cr.setUsername(ret.getUserName());
}
if(ret.getValidity()!=null)
{
cr.setValidity(ret.getValidity());
}
if(ret.getUpdaTime()!=null)
{
cr.setUpdatime(ret.getUpdaTime());
}
if(ret.getWebDepict()!=null)
{
cr.setWebdepict(ret.getWebDepict());
}
if(ret.getWebTittle()!=null)
{
cr.setWebtittle(ret.getWebTittle());
}
if(ret.getWeburl()!=null)
{
cr.setWeburl(ret.getWeburl());
}*/
if(ret!=null)
{
vc.add(ret);
}
// }
}
else
{
break;
}
}
else
{
break;
}
}
//proc = rt.exec(path+"test//imgserseek.exe closedb");
//s=bis.readChar();
} catch (Exception ex) {
ex.printStackTrace();
}
return vc;
}