?? xmltablereader.java
字號:
break;
case 5:
itsPriceInfo.setAgriUnit( text );
break;
case 6:
itsPriceInfo.setAgriDate( text );
break;
case 7:
itsPriceInfo.setAgriSite( text );
break;
case 8:
itsPriceInfo.setOther1( text );
break;
case 9:
itsPriceInfo.setOther2( text );
break;
}
}
}else
if( tableType.equalsIgnoreCase("agri_gqxx") )
{
name = this.SPlDEM_PREFIX + name;
posValue = DBConfig.getInstance().getProperty( name );
if( !(posValue==null || posValue.equalsIgnoreCase("")) )
{
pos = Integer.parseInt( posValue );
// System.out.println( name + "=>" + text + ", pos=" + pos );
switch( pos )
{
case 1:
itsSplDemInfo.setPageUrl( text );
break;
case 2:
itsSplDemInfo.setInfoTitle( text );
break;
case 3:
itsSplDemInfo.setInfoType( text );
break;
case 4:
itsSplDemInfo.setLinkMan( text );
break;
case 5:
itsSplDemInfo.setContactMeans( text );
break;
case 6:
itsSplDemInfo.setEmail( text );
break;
case 7:
itsSplDemInfo.setRegTime( text );
break;
case 8:
itsSplDemInfo.setInfoContent( text );
break;
case 9:
itsSplDemInfo.setOther1( text );
break;
case 10:
itsSplDemInfo.setOther2( text );
break;
}
}
}
else
if( tableType.equalsIgnoreCase("job_caiji") )
{
name = this.JOB_PRIFIX+ name;
posValue = DBConfig.getInstance().getProperty( name );
if( !(posValue==null || posValue.equalsIgnoreCase("")) )
{
pos = Integer.parseInt( posValue );
// System.out.println( name + "=>" + text + ", pos=" + pos );
switch( pos )
{
case 1:
itsJobInfo.setCompanyName( text );
break;
case 2:
itsJobInfo.setWorkAddr( text );
break;
case 3:
itsJobInfo.setSpeciality( text );
// System.out.println( text );
break;
case 4:
itsJobInfo.setDegree( text );
break;
case 5:
itsJobInfo.setJobExperience( text );
break;
case 6:
itsJobInfo.setJobStation( text );
break;
case 7:
itsJobInfo.setPublishTime( text );
break;
case 8:
itsJobInfo.setValidity( text );
break;
case 9:
itsJobInfo.setItsUrl( text );
break;
case 10:
itsJobInfo.setJobDescribe( text );
break;
case 11:
itsJobInfo.setJobStationReq( text );
break;
}
}
}else
if( tableType.equalsIgnoreCase("question_caiji") )
{
name = this.QUESTION_PRIFIX+ name;
posValue = DBConfig.getInstance().getProperty( name );
if( !(posValue==null || posValue.equalsIgnoreCase("")) )
{
pos = Integer.parseInt( posValue );
// System.out.println( name + "=>" + text + ", pos=" + pos );
switch( pos )
{
case 1:
itsQuestionInfo.setQtitle( text );
break;
case 2:
itsQuestionInfo.setQadvisory( text );
break;
case 3:
itsQuestionInfo.setLinkMethod( text );
break;
case 4:
itsQuestionInfo.setQuestion( text );
break;
case 5:
itsQuestionInfo.setQtime( text );
break;
case 6:
itsQuestionInfo.setAnswer( text );
break;
case 7:
itsQuestionInfo.setUrl( text );
break;
}
}
}
else if(tableType.equalsIgnoreCase("company_caiji") )
{
name = this.COMPANY_PRIFIX+ name;
posValue = DBConfig.getInstance().getProperty( name );
if( !(posValue==null || posValue.equalsIgnoreCase("")) )
{
pos = Integer.parseInt( posValue );
// System.out.println( name + "=>" + text + ", pos=" + pos );
switch( pos )
{
case 1:
itsCompanyInfo.setUsername( text );
break;
case 2:
itsCompanyInfo.setCompanyName( text );
break;
case 3:
itsCompanyInfo.setTel( text );
break;
case 4:
itsCompanyInfo.setAddr( text );
break;
case 5:
itsCompanyInfo.setInfo( text );
break;
case 6:
itsCompanyInfo.setCreateTime( text );
break;
case 7:
itsCompanyInfo.setPageUrl( text );
break;
}
}
}
} // end of the colums of a row
if( itsPriceInfo!=null )
{
String str = itsPriceInfo.getAgriMarket();
if( str.equals("") )
{
str = itsXmlName;
int si,sj;
si = str.indexOf( "/" );
si = str.indexOf( "/", si+1 );
sj = str.indexOf( "/", si+1 );
si = str.indexOf( "/", si+1 );
sj = str.indexOf( "/", si+1 );
if( si!=-1 && sj!=-1 )
str = str.substring( si+1, sj );
else
str = "";
itsPriceInfo.setAgriMarket( str );
}
// System.out.println( itsPriceInfo.getAgriMarket() );
DBManager.getInstance().inserPriceInfo2DB( itsPriceInfo );
itsPriceInfo = null;
}
if( itsSplDemInfo!=null )
{
DBManager.getInstance().inserSplDemInfo2DB( itsSplDemInfo );
itsSplDemInfo = null;
}
if( itsNewsInfo!=null )
{
DBManager.getInstance().insertNewsInfo2DB( itsNewsInfo );
itsNewsInfo = null;
}
if( itsMarketNewsInfo!=null )
{
DBManager.getInstance().insertMarketNewsInfo2DB( itsMarketNewsInfo );
itsMarketNewsInfo = null;
}
if( itsTechInfo!=null )
{
DBManager.getInstance().insertTechInfo2DB( itsTechInfo );
itsTechInfo = null;
}
if(itsJobInfo!=null)
{
DBManager.getInstance().InsertDBJobInfo( itsJobInfo );
itsJobInfo = null;
}
if(itsQuestionInfo!=null)
{
DBManager.getInstance().insertDBQuestionInfo( itsQuestionInfo );
itsQuestionInfo = null;
ii++;
System.out.println("共有:"+ii);
}
if(itsCompanyInfo!=null)
{
DBManager.getInstance().InsertDBCompanyInfo( itsCompanyInfo );
itsCompanyInfo = null;
ii++;
System.out.println("共有:"+ii);
}
}
}
public static void main(String args[])
{
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
String c=null;
try {
c=br.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
XmlTableReader xtr=new XmlTableReader(c);
xtr.readAll();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -