📄 dbmanager.java
字号:
if( i!=-1 && j==-1 )
info_type = "供应";
else
if( i==-1 && j!=-1 )
info_type = "求购";
else
info_type = "未知";
}
linkman = sdInfo.getLinkMan();
contact_means = sdInfo.getContactMeans();
email = sdInfo.getEmail();
if(sdInfo.getRegTime()!=null)
{
reg_time = DwDate.getInstance().formatDate(sdInfo.getRegTime().toString());
}
info_content = sdInfo.getInfoContent();
other1 = sdInfo.getOther1();
other2 = sdInfo.getOther2();
java.sql.Date collectedtime = sdInfo.getCollectedTime();
// page_url = SiteFilter.getInstance().filter( page_url );
info_title = ColonFilter.getInstance().filter( info_title );
info_type = ColonFilter.getInstance().filter( info_type );
linkman = ColonFilter.getInstance().filter( linkman );
contact_means = ColonFilter.getInstance().filter( contact_means );
info_content = ColonFilter.getInstance().filter( info_content );
if( info_content==null )
{
System.out.println( "info_content==null" );
return;
}
if( info_content.length()>=CONTENT_SIZE )
{
info_content = info_content.substring( 0, CONTENT_SIZE-500 );
}
other1 = ColonFilter.getInstance().filter( other1 );
other2 = ColonFilter.getInstance().filter( other2 );
if( !UrlCheck.getInstance().check( page_url ) )
{
// System.out.println( "!!!!!!!!!!!!!!!!!!!!" );
String str = "Ignore an item, mistake happen while insert the item into gqxx_tbl.";
// FileLoggerError.getInstance().warning( str );
FileLoggerError.getInstance().warning( str );
// System.out.println( "#########################" );
return;
}
String sql=null;
if( !oracleFlag )
{
sql = "insert into " + SUPDEM_TABLE + "(";
sql += "page_url, info_title, info_type, linkman, contact_means, email, reg_time, info_content, collectedtime, other1, other2) ";
sql += "values( '" + page_url + "', ";
sql += "'" + info_title + "', ";
sql += "'" + info_type + "', ";
sql += "'" + linkman + "', ";
sql += "'" + contact_means + "', ";
sql += "'" + email + "', ";
sql += "'" + reg_time + "', ";
sql += "'" + info_content + "', ";
sql += "'" + collectedtime + "', ";
sql += "'" + other1 + "', ";
sql += "'" + other2 + "' ) ";
// System.out.println( sql );
DBConnection.getInstance().executeInsert( sql );
}else
{
if(reg_time==null)
{
reg_time=collectedtime;
}
// String sdtable=null;
// sdtable = "gqxx_caiji";
sql = "insert into " + SUPDEM_TABLE + "(";
sql += "page_url, info_title, info_type, linkman, contact_means, email, reg_time, info_content, collectedtime, other1, other2) ";
sql += "values( '" + page_url + "', ";
sql += "'" + info_title + "', ";
sql += "'" + info_type + "', ";
sql += "'" + linkman + "', ";
sql += "'" + contact_means + "', ";
sql += "'" + email + "', ";
sql += "to_date('"+reg_time+"','yyyy-mm-dd'),";
sql += "?, ";
sql += "to_date('"+collectedtime+"','yyyy-mm-dd'),";
sql += "'" + other1 + "', ";
sql += "'" + other2 + "' ) ";
DBOracleConnection.getInstance().executeInsert( sql, info_content );
}
}
/**
* 完成招聘信息的插入工作。
* @param pInfo
*/
public void InsertDBCompanyInfo(CompanyInfo cInfo)
{
String userName ,companyName, Addr;
String Tel,Info,itsUrl;
java.sql.Date CreateTime;
// String validity,other1,itsUrl,jobdescribe,jobstationreq;
companyName = cInfo.getCompanyName();
Addr = cInfo.getAddr();
userName=cInfo.getUserName();
Tel=cInfo.getTel();
Info=cInfo.getInfo();
itsUrl=cInfo.getPageUrl();
java.sql.Date collectedtime = cInfo.getCollectedTime();
/*
Filt the fields
*/
companyName = ColonFilter.getInstance().filter( companyName );
Addr = ColonFilter.getInstance().filter(Addr );
if( !UrlCheck.getInstance().check( itsUrl ) )
{
String str = "Ignore an item, mistake happen while insert the item into company_tbl.";
FileLoggerError.getInstance().warning( str );
return;
}
String sql=null;
// if( !oracleFlag )
// {
// sql = "insert into " + PRICE_TABLE + "(";
// sql += "agriclass, agricategory, agrimarket,agriunit,agrisite,agriprice,agridate, collectedtime, other1, other2) ";
// sql += "values( '" + agriclass + "', ";
// sql += "'" + agricategory + "', ";
// sql += "'" + agrimarket + "', ";
// sql += "'" + agriunit + "', ";
// sql += "'" + agrisite + "', ";
// sql += "" + agriprice + ", ";
// sql += "'" + agridate + "', ";
// sql += "'" + collectedtime + "', ";
// sql += "'" + other1 + "', ";
// sql += "'" + other2 + "' ) ";
// // System.out.println( sql );
//
// DBConnection.getInstance().executeInsert( sql );
// }else
// {
//String pricetable = "agriprice_split";
// if(publishTime==null)
// {
// publishTime=collectedtime;
// }
sql = "insert into " + COMPANY_TABLE + "(";
sql += "USERNAME,CORP_NAME, CORP_TEL, CORP_ADDRESS ,CORP_INTRO,CORP_TIME1) ";
sql += "values( '" +userName + "', ";
sql += "'" + companyName + "', ";
sql += "'" + Tel + "', ";
sql += "'" + Addr + "', ";
sql += "? , ";
sql += "to_date('"+collectedtime+"','yyyy-mm-dd')) ";
// System.out.println( sql );
DBOracleConnection.getInstance().executeInsert( sql, Info);
// }
}
/**
* 完成专家问答信息的插入工作。
* @param pInfo
*/
public void insertDBQuestionInfo(QuestionInfo pInfo)
{
String title, question, answer;
String advisory,linkmethod,jobStation;
java.sql.Date publishTime;
String validity,other1,itsUrl,jobdescribe,jobstationreq;
title = pInfo.getQtitle();
question = pInfo.getQuestion();
answer = pInfo.getAnswer();
advisory = pInfo.getQadvisory();
linkmethod = pInfo.getLinkMethod();
// jobStation = pInfo.getJobStation();
publishTime = pInfo.getQtime();
itsUrl=pInfo.getUrl();
java.sql.Date collectedtime = pInfo.getCollectedtime();
// validity=pInfo.getValidity();
// other1 = pInfo.getOther();
// jobdescribe=pInfo.getJobDescribe();
// jobstationreq=pInfo.getJobStationReq();
/*
Filt the fields
*/
title = ColonFilter.getInstance().filter( title );
question = ColonFilter.getInstance().filter( question );
// speciality = ColonFilter.getInstance().filter(speciality );
// degreeReq = ColonFilter.getInstance().filter( degreeReq );
// agrisite = ColonFilter.getInstance().filter( agrisite );
// other1 = ColonFilter.getInstance().filter( other1 );
// jobExperience = ColonFilter.getInstance().filter( jobExperience );
if( !UrlCheck.getInstance().check( itsUrl ) )
{
String str = "Ignore an item, mistake happen while insert the item into agriprice_tbl.";
FileLoggerError.getInstance().warning( str );
return;
}
String sql=null;
// if( !oracleFlag )
// {
// sql = "insert into " + PRICE_TABLE + "(";
// sql += "agriclass, agricategory, agrimarket,agriunit,agrisite,agriprice,agridate, collectedtime, other1, other2) ";
// sql += "values( '" + agriclass + "', ";
// sql += "'" + agricategory + "', ";
// sql += "'" + agrimarket + "', ";
// sql += "'" + agriunit + "', ";
// sql += "'" + agrisite + "', ";
// sql += "" + agriprice + ", ";
// sql += "'" + agridate + "', ";
// sql += "'" + collectedtime + "', ";
// sql += "'" + other1 + "', ";
// sql += "'" + other2 + "' ) ";
// // System.out.println( sql );
//
// DBConnection.getInstance().executeInsert( sql );
// }else
// {
//String pricetable = "agriprice_split";
if(publishTime==null)
{
publishTime=collectedtime;
}
sql = "insert into " + QUESTION_TABLE + "(";
sql += "QTITLE, Qadvisory, LINKMETHOD ,Question,Qtime,Answer, PAGE_URL, COLLECTEDTIME) ";
sql += "values( '" + title + "', ";
sql += "'" + advisory + "', ";
sql += "'" + linkmethod + "', ";
sql += "'" + question + "', ";
sql += "to_date('"+publishTime+"','yyyy-mm-dd'), ";
sql += "?, ";
sql += "'" + itsUrl + "', ";
sql += "to_date('"+collectedtime+"','yyyy-mm-dd') ";
sql += " ) ";
// System.out.println( sql );
// System.out.println("answer:"+answer);
DBOracleConnection.getInstance().executeInsert( sql, answer );
// }
}
public void InsertDBJobInfo(JobInfo pInfo)
{
String companyName, workAddr, speciality;
String degreeReq,jobExperience,jobStation;
java.sql.Date publishTime;
String validity,other1,itsUrl,jobdescribe,jobstationreq;
companyName = pInfo.getCompanyName();
workAddr = pInfo.getWorkAddr();
speciality = pInfo.getSpeciality();
degreeReq = pInfo.getDegree();
jobExperience = pInfo.getJobExperience();
jobStation = pInfo.getJobStation();
publishTime = pInfo.getPublishTime();
itsUrl=pInfo.getItsUrl();
java.sql.Date collectedtime = pInfo.getCollectedTime();
validity=pInfo.getValidity();
other1 = pInfo.getOther();
jobdescribe=pInfo.getJobDescribe();
jobstationreq=pInfo.getJobStationReq();
/*
Filt the fields
*/
companyName = ColonFilter.getInstance().filter( companyName );
workAddr = ColonFilter.getInstance().filter( workAddr );
speciality = ColonFilter.getInstance().filter(speciality );
degreeReq = ColonFilter.getInstance().filter( degreeReq );
// agrisite = ColonFilter.getInstance().filter( agrisite );
other1 = ColonFilter.getInstance().filter( other1 );
jobExperience = ColonFilter.getInstance().filter( jobExperience );
if( !UrlCheck.getInstance().check( itsUrl ) )
{
String str = "Ignore an item, mistake happen while insert the item into agriprice_tbl.";
FileLoggerError.getInstance().warning( str );
return;
}
String sql=null;
// if( !oracleFlag )
// {
// sql = "insert into " + PRICE_TABLE + "(";
// sql += "agriclass, agricategory, agrimarket,agriunit,agrisite,agriprice,agridate, collectedtime, other1, other2) ";
// sql += "values( '" + agriclass + "', ";
// sql += "'" + agricategory + "', ";
// sql += "'" + agrimarket + "', ";
// sql += "'" + agriunit + "', ";
// sql += "'" + agrisite + "', ";
// sql += "" + agriprice + ", ";
// sql += "'" + agridate + "', ";
// sql += "'" + collectedtime + "', ";
// sql += "'" + other1 + "', ";
// sql += "'" + other2 + "' ) ";
// // System.out.println( sql );
//
// DBConnection.getInstance().executeInsert( sql );
// }else
// {
//String pricetable = "agriprice_split";
if(publishTime==null)
{
publishTime=collectedtime;
}
sql = "insert into " + JOB_TABLE + "(";
sql += "companyName, workAddr, SPECIALITY ,DEGREEREQ,JOBEXPERIENCE,PUBLISHTIME,JOBSTATION,JOBSTATIONREQ, COLLECTEDTIME,VALIDITY, PAGE_URL,JOBDESCRIBE) ";
sql += "values( '" + companyName + "', ";
sql += "'" + workAddr + "', ";
sql += "'" + speciality + "', ";
sql += "'" + degreeReq + "', ";
sql += "'" + jobExperience + "', ";
sql += "to_date('"+publishTime+"','yyyy-mm-dd'), ";
sql += "'" + jobStation + "', ";
sql += " ? , ";
sql += "to_date('"+collectedtime+"','yyyy-mm-dd'), ";
sql += "'" + validity + "', ";
sql += "'" + itsUrl + "', ";
sql += "'" + jobdescribe + "' ) ";
// System.out.println( sql );
DBOracleConnection.getInstance().executeInsert( sql, jobstationreq );
// }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -