S
Shannon
I have an application that came to a grinding halt yesterday for no
apparent reason. After looking into it I discovered that the file
system had reached its capacity. My java guru is on holidays and wont
be back for a week so I have been left to try and resolve this in his
absence.
In the tomcat logs directory the file "localhost_log-YYY-MM-DD.txt" is
growing to 45MB in size every day. When looking into the file it
contains the same error message over and over again:
java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
I have checked the Catalina.log file as well and it was at 1.5GB in
size again with the exact same message repeating throughout the file:
java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1278)
at java.ibjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.ibjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.ibjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.ibjectInputStream.readArray(ObjectInputStream.java:1603)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.ibjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.ibjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.ibjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.ibjectInputStream.readObject(ObjectInputStream.java:324)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
at org.apache.catalina.session.FileStore.load(FileStore.java:337)
at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:308)
at org.apache.catalina.session.StoreBase.run(StoreBase.java:376)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
I do not understand what this is telling me. The RemoteSiteRecord.java
file contains the following:
package com.reynolds.partsalesSharedUtilities.RemoteSite;
import java.sql.*;
import java.util.*;
import com.reynolds.partsalesSharedUtilities.*;
import com.reynolds.partsalesSharedUtilities.Connections.*;
import com.reynolds.exceptions.*;
import com.reynolds.tools.*;
import com.reynolds.pick.*;
import com.reynolds.sockets.*;
import ContextServlet;
public class RemoteSiteRecord {
public String message ="";
private String siteName = "";
private String storeNum = "";
private String portRange = "";
private String pricingPortRange = "";
private String dlrName = "";
private String dlrAddress = "";
private String dlrSuburb = "";
private String dlrState = "";
private String dlrPostcode = "";
private String dlrPhone = "";
private String dlrFax = "";
private String dlrEmail = "";
private String dlrMakeID = "";
private String createDate = "";
private String dlrComments = "";
private String nonEra = "";
private String nonEraSub = "";
private String siteID = "";
private String countryID = "";
private String splitSize = "";
private String dlrStatus = "";
private String isDistributor = "";
private String eraVersion = "";
private String showLookup = "";
private String searchType = "";
private String lastUpload = "";
private boolean selectTransCode = false;
private boolean viewSource = false;
private String emailOrder = "";
private String dlrCode = "";
private String dlrPartsManager = "";
private String updateStmt = "";
private String batchusername = "";
private String batchpassword = "";
private String batchhome = "";
private String batchhome2 = "";
private String batchflag = "";
private String batchemail = "";
private boolean factoryInq = false; // 04ckw
private String crashbook = ""; // alvin changes 9-04-03
private String altcrashbook = ""; // alvin changes 9-04-03
//05ckw start
private boolean viewPack = false;
private boolean viewTaxCode = false;
private boolean viewDetail = false;
private boolean viewClass = false;
private boolean viewRemarks = false;
private boolean viewMdlAppl = false;
private boolean viewSalesHist = false;
private boolean viewBranchInq = false;
//05ckw end
private java.sql.Date ScreateDate; //SQL Date object
private java.util.Date JcreateDate; //java Date object
private java.sql.Date SuploadDate; //SQL Date object
private java.util.Date JuploadDate; //java Date object
private boolean dealerPopulated = false;
// null constructor
public RemoteSiteRecord(){
}
// constructor for insert method
public RemoteSiteRecord(int countryID){
this.countryID = (new Integer(countryID)).toString();
}
public RemoteSiteRecord(String nodeID) throws Exception {
retrieveSiteRecord(nodeID);
dealerPopulated = true;
}
// constructor
public RemoteSiteRecord(String siteID, int countryID) throws
Exception {
retrieveSiteRecord(siteID, countryID);
this.countryID = (new Integer(countryID)).toString();
dealerPopulated = true;
}
public RemoteSiteRecord(String siteName, String storeNum, String
dlrMakeID, int countryID) throws Exception{
retrieveSiteRecord(siteName,storeNum,dlrMakeID, countryID);
this.countryID = (new Integer(countryID)).toString();
dealerPopulated = true;
}
// getter/setter methods
public String getBatchEmail(){
return batchemail;
}
public void setBatchEmail(String x){
batchemail = x;
}
public String getBatchFlag(){
return batchflag;
}
public void setBatchFlag(String x){
batchflag = x;
}
public String getBatchUserName(){
return batchusername;
}
public void setBatchUserName(String x){
batchusername = x;
}
public String getBatchPassword(){
return batchpassword;
}
public void setBatchPassword(String x){
batchpassword = x;
}
public String getBatchHome(){
return batchhome;
}
public void setBatchHome(String x){
batchhome = x;
}
public String getBatchHome2(){
return batchhome2;
}
public void setBatchHome2(String x){
batchhome2 = x;
}
public String getSiteID(){
return siteID;
}
public void setSiteID(String x){
siteID = x;
}
public String getCountryID(){
return countryID;
}
public void setCountryID(String x){
countryID = x;
}
public String getSplitSize(){
return splitSize;
}
public void setSplitSize(String x){
splitSize = x;
}
public String getDlrStatus(){
return dlrStatus;
}
public void setDlrStatus(String x){
dlrStatus = x;
}
public String getSiteName(){
return siteName;
}
public void setSiteName(String x){
siteName = x;
}
public String getStoreNum(){
return storeNum;
}
public void setStoreNum(String x){
storeNum = x;
}
public String getPortRange(){
return portRange;
}
public void setPortRange(String x){
portRange = x;
}
public String getNonEra(){
return nonEra;
}
public void setNonEra(String x){
nonEra = x;
}
public String getNonEraSub(){
return nonEraSub;
}
public void setNonEraSub(String x){
nonEraSub = x;
}
public String getDlrName(){
return dlrName;
}
//alvinoh ins start
public void setCrashBook(String x){
crashbook = x;
}
public String getCrashBook(){
return crashbook;
}
public void setAltCrashBook(String x){
altcrashbook = x;
}
public String getAltCrashBook(){
return altcrashbook;
}
//alvinoh ins end
//05ckw ins start
public boolean getViewPack(){
return viewPack;
}
public boolean getViewBranchInq(){
return viewBranchInq;
}
public boolean getViewTaxCode(){
return viewTaxCode;
}
public boolean getViewDetail(){
return viewDetail;
}
public boolean getViewRemarks(){
return viewRemarks;
}
public boolean getViewClass(){
return viewClass;
}
public boolean getViewMdlAppl(){
return viewMdlAppl;
}
public boolean getViewSalesHist(){
return viewSalesHist;
}
public boolean viewMasterInq(){
if(viewPack || viewTaxCode || viewDetail || viewRemarks || viewClass
|| viewMdlAppl || viewSalesHist || viewBranchInq) return true;
return false;
}
public void setViewPack(boolean x){
this.viewPack = x;
}
public void setViewBranchInq(boolean x){
this.viewBranchInq = x;
}
public void setViewTaxCode(boolean x){
this.viewTaxCode = x;
}
public void setViewDetail(boolean x){
this.viewDetail = x;
}
public void setViewRemarks(boolean x){
this.viewRemarks = x;
}
public void setViewClass(boolean x){
this.viewClass = x;
}
public void setViewMdlAppl(boolean x){
this.viewMdlAppl = x;
}
public void setViewSalesHist(boolean x){
this.viewSalesHist = x;
}
//05ckw ins end
public void setDlrName(String x){
dlrName = x;
}
public String getDlrAddress(){
return dlrAddress;
}
public void setDlrAddress(String x){
dlrAddress = x;
}
public String getDlrSuburb(){
return dlrSuburb;
}
public void setDlrSuburb(String x){
dlrSuburb = x;
}
public String getDlrState(){
return dlrState;
}
public void setDlrState(String x){
dlrState = x;
}
public String getDlrPostcode(){
return dlrPostcode;
}
public void setDlrPostcode(String x){
dlrPostcode = x;
}
public String getDlrPhone(){
return dlrPhone;
}
public void setDlrPhone(String x){
dlrPhone = x;
}
public String getDlrFax(){
return dlrFax;
}
public void setDlrFax(String x){
dlrFax = x;
}
public String getDlrEmail(){
return dlrEmail;
}
public void setDlrEmail(String x){
dlrEmail = x;
}
public String getDlrMakeID(){
return dlrMakeID;
}
public void setDlrMakeID(String x){
dlrMakeID = x;
}
public String getCreateDate(){
return createDate;
}
public void setCreateDate(String x){
createDate = x;
}
public String getDlrComments(){
return dlrComments;
}
public void setDlrComments(String x){
dlrComments = x;
}
public String getPricingPortRange(){
return pricingPortRange;
}
public void setPricingPortRange(String x){
pricingPortRange = x;
}
public int getStartPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
int startPort = Integer.parseInt(st.nextToken());
return startPort;
}
public int getDefaultPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
String temp = st.nextToken();
temp = st.nextToken();
int defaultPort = Integer.parseInt(st.nextToken());
return defaultPort;
}
public int getEndPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
String temp = st.nextToken();
int endPort = Integer.parseInt(st.nextToken());
return endPort;
}
public int getPricingStartPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
int startPort = Integer.parseInt(st.nextToken());
return startPort;
}
public int getPricingDefaultPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
String temp = st.nextToken();
temp = st.nextToken();
int defaultPort = Integer.parseInt(st.nextToken());
return defaultPort;
}
public int getPricingEndPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
String temp = st.nextToken();
int endPort = Integer.parseInt(st.nextToken());
return endPort;
}
public String getIsDistributor(){
return isDistributor;
}
public void setIsDistributor(String x){
isDistributor = x;
}
public String getEraVersion(){
return eraVersion;
}
public void setEraVersion(String x){
eraVersion = x;
}
public String getSearchType(){
return searchType;
}
public void setSearchType(String x){
searchType = x;
}
public java.sql.Date getSUploadDate(){
return SuploadDate;
}
public void setSUploadDate( java.sql.Date x ){
SuploadDate = x;
}
public java.util.Date getJUploadDate(){
return JuploadDate;
}
public void setJUploadDate( java.util.Date x ){
JuploadDate = x;
}
public String getShowLookup(){
return showLookup;
}
public void setShowLookup(String x){
showLookup = x;
}
public java.sql.Date getSCreateDate(){
return ScreateDate;
}
public void setSCreateDate( java.sql.Date x ){
ScreateDate = x;
}
public java.util.Date getJCreateDate(){
return JcreateDate;
}
public void setJCreateDate( java.util.Date x ){
JcreateDate = x;
}
public void setSelectTransCode(boolean selectTransCode){
this.selectTransCode = selectTransCode;
}
public boolean getSelectTransCode(){
return selectTransCode;
}
public void setViewSource(boolean viewSource){
this.viewSource = viewSource;
}
public boolean getViewSource(){
return viewSource;
}
public String getEmailOrder(){
return emailOrder;
}
public void setEmailOrder(String x){
emailOrder = x;
}
public String getDlrCode(){
return dlrCode;
}
public void setDlrCode(String x){
dlrCode = x;
}
//04ckw start
public boolean getFactoryInq(){
return factoryInq;
}
public void setFactoryInq(boolean factoryInq){
this.factoryInq = factoryInq;
}
//04ckw end
public void setDlrPartsManager(String x){
dlrPartsManager = x;
}
public String getDlrPartsManager(){
return dlrPartsManager;
}
public Vector getAttachedUsers() throws SQLException {
return retrieveAttachedUsers(siteID, Integer.parseInt(countryID));
}
// this function returns true if the site is a dealer.partsales
parent site
public boolean isParent() throws SQLException {
DealerGroupRecord dgr = new DealerGroupRecord();
return dgr.isParent(siteID, Integer.parseInt(countryID));
}
/** 06ckw ins start
This method has to be fixed, at the moment only used for toyota tsusho
*/
public boolean viewCasePartSearch(){
if(siteID.equals("1065") || siteID.equals("1064")){
return true;
}
return false;
}
//function to return a string representation of a user record
public String toString () {
String recordString = "";
recordString = siteID + " " + siteName + " " + storeNum + " " +
splitSize + " " + portRange + " " + nonEra + " "
+ dlrStatus + " " + dlrName + " " + dlrAddress + " " + dlrSuburb +
" " + dlrState + " " + dlrPostcode + " "
+ dlrPhone + " " + dlrFax + " " + dlrEmail + " " + dlrMakeID + " "
+ createDate + " " + dlrComments + " " + countryID + " " +
pricingPortRange + " " + isDistributor + " " + nonEraSub + " " +
eraVersion + " " + showLookup + " " + searchType + " " + lastUpload +
" " + viewSource + " " + selectTransCode + " " + emailOrder + " " +
dlrCode + " " + dlrPartsManager + " " + factoryInq + " " + batchflag +
" " + batchusername + " " +
batchpassword + " " + batchhome + " " + batchemail + " " +
batchhome2;
return recordString;
}
private void retrieveSiteRecord(String siteID, int countryID) throws
SQLException, Exception {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_ID = " + siteID
+ " ORDER BY DLR_NAME";
message = sqlString;
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = siteID;
siteName = rs.getString("SITE_NAME");
storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
ScreateDate = rs.getDate("CREATE_DATE");
JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
searchType = rs.getString("SEARCH_TYPE");
lastUpload = rs.getString("LAST_UPLOAD") ;
SuploadDate = rs.getDate("LAST_UPLOAD") ;
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
JuploadDate = SuploadDate!=null?SuploadDate.valueOf(SuploadDate.toString()):null;
//not sure if this is the best way to do this
viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist\n<br>--> In
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord:
while retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
private void retrieveSiteRecord(String siteName,String
storeNum,String dlrMakeID, int countryID) throws Exception,
SQLException {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
siteName
+ "\' AND STORE_NUM = \'" + storeNum + "\' AND
DLR_MAKE_ID = \'" + dlrMakeID + "\'"
+ " ORDER BY DLR_NAME ";
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = rs.getString("SITE_ID");
this.siteName = rs.getString("SITE_AME");
this.storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
this.dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
dlrComments = rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
searchType = rs.getString("SEARCH_TYPE");
lastUpload = rs.getString("LAST_UPLOAD");
viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
//this retrieves the first record with passed nodeID
private void retrieveSiteRecord(String nodeID) throws SQLException,
Exception {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
this.countryID = ContextServlet.getApplParameter("countryID");
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
nodeID + "\'";
message = sqlString;
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = rs.getString("SITE_ID");
siteName = rs.getString("SITE_NAME");
storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
ScreateDate = rs.getDate("CREATE_DATE");
JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
lastUpload = rs.getString("LAST_UPLOAD") ;
SuploadDate = rs.getDate("LAST_UPLOAD") ;
if(SuploadDate != null){
JuploadDate = SuploadDate.valueOf(SuploadDate.toString()); //not
sure if this is the best way to do this
}else{
JuploadDate = null;
} viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
private Vector retrieveAttachedUsers(String siteID, int countryID)
throws SQLException {
Vector attachedUsers = new Vector();
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT USER_ID FROM USER_DEALERS WHERE SITE_ID = " +
siteID ;
rs = stmt.executeQuery(sqlString);
while ( rs.next() ){
attachedUsers.addElement(rs.getString("USER_ID"));
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
return attachedUsers;
}
// validates user entered data
private void testVariables () throws IncompleteFormDataException,
IncompleteDataException {
// user/programmer errors
if (storeNum.equals("")){ throw new
IncompleteFormDataException("Store Number is a required field"); }
if (portRange.equals("")) { throw new
IncompleteFormDataException("Port Range is a required field"); }
if (dlrName.equals("")) { throw new
IncompleteFormDataException("Dealer Name is a required field"); }
if (dlrState.equals("")) { throw new
IncompleteFormDataException("Dealer State is a required field"); }
if (dlrEmail.equals("")) { throw new
IncompleteFormDataException("Dealer Email is a required field"); }
if (dlrMakeID.equals("")) { throw new
IncompleteFormDataException("Dealer Make ID is a required field"); }
if (nonEra.equals("")) { throw new IncompleteFormDataException("Non
Era is a required field"); }
if (splitSize.equals("")) { throw new
IncompleteFormDataException("Split size is a required field"); }
if (dlrStatus.equals("")) { throw new
IncompleteFormDataException("Dealer status is a required field"); }
}
public void dealerInsert(int countryID) throws SQLException,
IncompleteFormDataException, IncompleteDataException,
DealerAlreadyExistsException
{
Connection con = null;
Statement stmt = null;
String stmtString = "";
SQLFormatter sf = new SQLFormatter();
this.countryID = new Integer(countryID).toString();
testVariables();
retrieveSiteID(countryID);
try{
con = PartsalesOracleConnection.getConnection(countryID);
con.setAutoCommit(false);
stmt = con.createStatement();
stmtString = "INSERT INTO REMOTE_SITES "
+ "(SITE_ID, "
+ " SITE_NAME, "
+ " STORE_NUM, "
+ " SPLIT_SIZE, "
+ " PORT_RANGE, "
+ " NON_ERA,"
+ " DLR_STATUS, "
+ " DLR_NAME, "
+ " DLR_ADDR, "
+ " DLR_SUBURB, "
+ " DLR_STATE, "
+ " DLR_POSTCODE,"
+ " DLR_PHONE, "
+ " DLR_FAX, "
+ " DLR_EMAIL, "
+ " DLR_MAKE_ID, "
+ " CREATE_DATE, "
+ " DLR_COMMENTS,"
+ " COUNTRY_ID, "
+ " PRICING_PORT_RANGE, "
+ " IS_DISTRIBUTOR, "
+ " NON_ERA_SUB, "
+ " ERA_VERSION, "
+ " VIEW_LOOKUP, "
+ " SEARCH_TYPE, "
+ " VIEW_SRC, "
+ " SEL_TC, "
+ " EMAIL_ORDER_ID, "
+ " DLR_CODE, "
+ " FACT_INQ, " // 04CKW ADD
+ " BATCH_FLAG, "
+ " BATCH_USERNAME, "
+ " BATCH_PASSWORD, "
+ " BATCH_EMAIL, "
+ " BATCH_HOME, "
+ " HOME_DIRECTORY, "
//05CKW INS START
+ " VIEW_PACK, "
+ " VIEW_SALES_HIST, "
+ " VIEW_REMARKS, "
+ " VIEW_DETAIL, "
+ " VIEW_CLASS, "
+ " VIEW_TAX_CODE, "
+ " VIEW_MDL_APPL, "
+ " VIEW_BRANCH_INQ, "
//05CKW INS END
//alvinoh INS START
+ " VIEW_CRASHBOOK, "
+ " VIEW_ALT_CRASHBOOK, "
//alvinoh INS END
+ " PARTS_MANAGER)"
+ " VALUES ("
+ siteID + ","
+ "'" + siteName + "',"
+ "'" + storeNum + "',"
+ splitSize + ","
+ "'" + portRange + "',"
+ "'" + nonEra + "',"
+ dlrStatus + ","
+ "'" + sf.format(dlrName) + "',"
+ "'" + sf.format(dlrAddress) + "',"
+ "'" + sf.format(dlrSuburb) + "',"
+ "'" + dlrState + "',"
+ "'" + dlrPostcode + "',"
+ "'" + dlrPhone + "',"
+ "'" + dlrFax + "',"
+ "'" + dlrEmail + "',"
+ "'" + dlrMakeID + "',"
+ "CURRENT TIMESTAMP,"
+ "'" + sf.format(dlrComments) + "',"
+ countryID + ","
+ "'" + pricingPortRange + "',"
+ "'" + isDistributor + "',"
+ "'" + nonEraSub + "',"
+ "'" + eraVersion +"',"
+ "'" + showLookup +"',"
+ searchType + ","
+ "'" + (new Boolean(viewSource)).toString() + "',"
+ "'" + (new Boolean(selectTransCode)).toString() + "',"
+ "'" + emailOrder + "',"
+ "'" + dlrCode + "',"
+ "'" + (new Boolean(factoryInq)).toString() + ","
+ "'" + batchflag + "',"
+ "'" + batchusername + "',"
+ "'" + batchpassword + "',"
+ "'" + batchemail + "',"
+ "'" + batchhome + "',"
+ "'" + batchhome2 + "',"
//05CKW INS START
+ "'" + viewPack + "',"
+ "'" + viewSalesHist + "',"
+ "'" + viewRemarks + "',"
+ "'" + viewDetail + "',"
+ "'" + viewClass + "',"
+ "'" + viewTaxCode + "',"
+ "'" + viewMdlAppl + "',"
+ "'" + viewBranchInq + "',"
//05CKW INS END
//alvinoh INS START
+ "'" + crashbook + "',"
+ "'" + altcrashbook + "',"
//alvinoh INS END
+ "'" + dlrPartsManager + "')";
stmt.executeUpdate(stmtString);
// update log_sites
stmtString = "INSERT INTO LOG_SITES (SITE_ID, SITE_STATUS,
DATE_MOD)"
+ " VALUES (" + siteID + "," + dlrStatus + ",CURRENT
TIMESTAMP)";
stmt.executeUpdate(stmtString);
//commit changes to database
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
try {
con.rollback();
con.setAutoCommit(true);
} catch (Exception ex){}
if (e.getErrorCode() == 1){
throw new DealerAlreadyExistsException ("This dealer already
exists");
}
throw new SQLException (e.toString() + "<br>--> " + stmtString);
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
public void delete() throws SQLException, IncompleteFormDataException
{
Connection con = null;
Statement stmt = null;
String stmtString = "";
if (!dealerPopulated){
throw new IncompleteFormDataException("getUserDetails() method not
called");
}
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
con.setAutoCommit(false);
stmt = con.createStatement();
stmt.executeUpdate("DELETE FROM REMOTE_SITES WHERE SITE_ID = " +
siteID );
stmt.executeUpdate("DELETE FROM USER_DEALERS WHERE SITE_ID = " +
siteID);
stmt.executeUpdate("DELETE FROM DEALER_GROUPS WHERE SITE_ID = " +
siteID);
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
con.rollback();
con.setAutoCommit(true);
throw e;
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
private void retrieveSiteID(int countryID) throws SQLException {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try{
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
String stmtString = "SELECT NEXTVAL FOR SITE_ID_SEQ FROM
RNRDB2.DUAL";
rs = stmt.executeQuery(stmtString);
rs.next();
siteID = rs.getString("1");
rs.close();
stmt.close();
con.close();
} finally {
try { rs.close(); }
catch (Exception e) {}
try { stmt.close(); }
catch (Exception e) {}
try { con.close(); }
catch (Exception e) {}
}
}
public void dealerUpdate() throws IncompleteFormDataException,
IncompleteDataException , SQLException {
Connection con = null;
Statement stmt = null;
String stmtString = "";
SQLFormatter sf = new SQLFormatter();
// A call to getUserDetails() must be made before updating user
if (!dealerPopulated){
throw new IncompleteFormDataException("retrieveSiteRecord() method
not called");
}
testVariables();
// fix any variables that might possible have apostrophes in them
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
con.setAutoCommit(false);
stmt = con.createStatement();
updateStmt = "UPDATE REMOTE_SITES SET";
addSQL("SITE_NAME", "'" + siteName + "'");
addSQL("STORE_NUM", "'" + storeNum + "'");
addSQL("SPLIT_SIZE", splitSize);
addSQL("PORT_RANGE", "'" + portRange + "'");
addSQL("NON_ERA", "'" + nonEra + "'");
addSQL("DLR_STATUS", dlrStatus);
addSQL("DLR_NAME", "'" + sf.format(dlrName)+ "'");
addSQL("DLR_ADDR", "'" + sf.format(dlrAddress)+ "'" );
addSQL("DLR_SUBURB", "'" + sf.format(dlrSuburb)+ "'");
addSQL("DLR_STATE", "'" + dlrState + "'");
addSQL("DLR_POSTCODE", "'" + dlrPostcode + "'");
addSQL("DLR_PHONE", "'" + dlrPhone + "'");
addSQL("DLR_FAX", "'" + dlrFax + "'");
addSQL("DLR_EMAIL", "'" + dlrEmail + "'");
addSQL("DLR_MAKE_ID", "'" + dlrMakeID + "'");
addSQL("DLR_COMMENTS", "'" + sf.format(dlrComments) + "'");
addSQL("COUNTRY_ID", countryID);
addSQL("PRICING_PORT_RANGE", "'" + pricingPortRange + "'");
addSQL("IS_DISTRIBUTOR", "'" + isDistributor + "'");
addSQL("NON_ERA_SUB", "'" + nonEraSub + "'");
addSQL("ERA_VERSION","'" + eraVersion + "'");
addSQL("VIEW_LOOKUP","'" + showLookup + "'");
addSQL("SEARCH_TYPE", searchType);
addSQL("VIEW_SRC", "'" + (new Boolean(viewSource)).toString() +
"'");
addSQL("SEL_TC","'" + (new Boolean(selectTransCode)).toString() +
"'");
addSQL("EMAIL_ORDER_ID", "'" + emailOrder + "'");
addSQL("DLR_CODE", "'" + dlrCode + "'");
addSQL("PARTS_MANAGER", "'" + dlrPartsManager + "'");
addSQL("FACT_INQ", "'" + (new Boolean(factoryInq)).toString() +
"'");
addSQL("BATCH_FLAG","'" + batchflag + "'");
addSQL("BATCH_USERNAME","'" + batchusername + "'");
addSQL("BATCH_PASSWORD","'" + batchpassword + "'");
addSQL("BATCH_EMAIL","'" + batchemail + "'");
addSQL("BATCH_HOME","'" + batchhome + "'");
addSQL("HOME_DIRECTORY","'" + batchhome2 + "'");
//05CKW INS START
addSQL("VIEW_PACK","'" + viewPack + "'");
addSQL("VIEW_DETAIL","'" + viewDetail + "'");
addSQL("VIEW_REMARKS","'" + viewRemarks + "'");
addSQL("VIEW_CLASS","'" + viewClass + "'");
addSQL("VIEW_SALES_HIST","'" + viewSalesHist + "'");
addSQL("VIEW_TAX_CODE","'" + viewTaxCode + "'");
addSQL("VIEW_MDL_APPL","'" + viewMdlAppl + "'");
addSQL("VIEW_BRANCH_INQ","'" + viewMdlAppl + "'");
//05CKW INS END
//alvinoh INS START
addSQL("VIEW_CRASHBOOK","'" + crashbook + "'");
addSQL("VIEW_ALT_CRASHBOOK","'" + altcrashbook + "'");
//alvinoh INS END
updateStmt += " WHERE SITE_ID = " + siteID;
stmt.executeUpdate(updateStmt);
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
try {
con.rollback();
con.setAutoCommit(true);
} catch (Exception ex) {}
throw new SQLException (e.toString() + "<br>\n---> Copy And Paste
following statement and send to (e-mail address removed)<br>\n" +
updateStmt);
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
public void addSQL(String column, String value) {
// If value does not equal null then add to updateStmt
if (value!=null) {
if (updateStmt.equals("UPDATE REMOTE_SITES SET")) { updateStmt += "
" + column + " = " + value ; }
else { updateStmt += " ," + column + " = " + value ; }
}
}
public boolean backupRunning(int countryID) throws
ConnectionException,SQLException,InvalidGroupException{
boolean backupRunning = false;
// this.countryID = ContextServlet.getApplParameter("countryID");
// 07ckw del if (!(new
DealerGroupRecord(siteID,countryID)).getParent().equals("7") && !(new
DealerGroupRecord(siteID,countryID)).getParent().equals("113"))
//07ckw ins start
if ((new DealerGroupRecord(siteID,countryID)).getParent().equals("1065")) {
//07ckw ins end
try
{
PartsalesConnection dealerConnection = new
PartsalesConnection(this,"dealerlink");
PickRecord pr = PickRecord.read("0","ERABACKUP","CONTROL.BACKUP",
"1", "R",dealerConnection,this.getStoreNum());
if (pr.getPickRecord().equalsIgnoreCase("Y")){
backupRunning = true;
}
}catch(ConnectionException ce){};
}
return backupRunning;
}
}
Is anyone able to decipher this for me?????
apparent reason. After looking into it I discovered that the file
system had reached its capacity. My java guru is on holidays and wont
be back for a week so I have been left to try and resolve this in his
absence.
In the tomcat logs directory the file "localhost_log-YYY-MM-DD.txt" is
growing to 45MB in size every day. When looking into the file it
contains the same error message over and over again:
java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
I have checked the Catalina.log file as well and it was at 1.5GB in
size again with the exact same message repeating throughout the file:
java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1278)
at java.ibjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.ibjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.ibjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.ibjectInputStream.readArray(ObjectInputStream.java:1603)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.ibjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.ibjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.ibjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.ibjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.ibjectInputStream.readObject(ObjectInputStream.java:324)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
at org.apache.catalina.session.FileStore.load(FileStore.java:337)
at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:308)
at org.apache.catalina.session.StoreBase.run(StoreBase.java:376)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
I do not understand what this is telling me. The RemoteSiteRecord.java
file contains the following:
package com.reynolds.partsalesSharedUtilities.RemoteSite;
import java.sql.*;
import java.util.*;
import com.reynolds.partsalesSharedUtilities.*;
import com.reynolds.partsalesSharedUtilities.Connections.*;
import com.reynolds.exceptions.*;
import com.reynolds.tools.*;
import com.reynolds.pick.*;
import com.reynolds.sockets.*;
import ContextServlet;
public class RemoteSiteRecord {
public String message ="";
private String siteName = "";
private String storeNum = "";
private String portRange = "";
private String pricingPortRange = "";
private String dlrName = "";
private String dlrAddress = "";
private String dlrSuburb = "";
private String dlrState = "";
private String dlrPostcode = "";
private String dlrPhone = "";
private String dlrFax = "";
private String dlrEmail = "";
private String dlrMakeID = "";
private String createDate = "";
private String dlrComments = "";
private String nonEra = "";
private String nonEraSub = "";
private String siteID = "";
private String countryID = "";
private String splitSize = "";
private String dlrStatus = "";
private String isDistributor = "";
private String eraVersion = "";
private String showLookup = "";
private String searchType = "";
private String lastUpload = "";
private boolean selectTransCode = false;
private boolean viewSource = false;
private String emailOrder = "";
private String dlrCode = "";
private String dlrPartsManager = "";
private String updateStmt = "";
private String batchusername = "";
private String batchpassword = "";
private String batchhome = "";
private String batchhome2 = "";
private String batchflag = "";
private String batchemail = "";
private boolean factoryInq = false; // 04ckw
private String crashbook = ""; // alvin changes 9-04-03
private String altcrashbook = ""; // alvin changes 9-04-03
//05ckw start
private boolean viewPack = false;
private boolean viewTaxCode = false;
private boolean viewDetail = false;
private boolean viewClass = false;
private boolean viewRemarks = false;
private boolean viewMdlAppl = false;
private boolean viewSalesHist = false;
private boolean viewBranchInq = false;
//05ckw end
private java.sql.Date ScreateDate; //SQL Date object
private java.util.Date JcreateDate; //java Date object
private java.sql.Date SuploadDate; //SQL Date object
private java.util.Date JuploadDate; //java Date object
private boolean dealerPopulated = false;
// null constructor
public RemoteSiteRecord(){
}
// constructor for insert method
public RemoteSiteRecord(int countryID){
this.countryID = (new Integer(countryID)).toString();
}
public RemoteSiteRecord(String nodeID) throws Exception {
retrieveSiteRecord(nodeID);
dealerPopulated = true;
}
// constructor
public RemoteSiteRecord(String siteID, int countryID) throws
Exception {
retrieveSiteRecord(siteID, countryID);
this.countryID = (new Integer(countryID)).toString();
dealerPopulated = true;
}
public RemoteSiteRecord(String siteName, String storeNum, String
dlrMakeID, int countryID) throws Exception{
retrieveSiteRecord(siteName,storeNum,dlrMakeID, countryID);
this.countryID = (new Integer(countryID)).toString();
dealerPopulated = true;
}
// getter/setter methods
public String getBatchEmail(){
return batchemail;
}
public void setBatchEmail(String x){
batchemail = x;
}
public String getBatchFlag(){
return batchflag;
}
public void setBatchFlag(String x){
batchflag = x;
}
public String getBatchUserName(){
return batchusername;
}
public void setBatchUserName(String x){
batchusername = x;
}
public String getBatchPassword(){
return batchpassword;
}
public void setBatchPassword(String x){
batchpassword = x;
}
public String getBatchHome(){
return batchhome;
}
public void setBatchHome(String x){
batchhome = x;
}
public String getBatchHome2(){
return batchhome2;
}
public void setBatchHome2(String x){
batchhome2 = x;
}
public String getSiteID(){
return siteID;
}
public void setSiteID(String x){
siteID = x;
}
public String getCountryID(){
return countryID;
}
public void setCountryID(String x){
countryID = x;
}
public String getSplitSize(){
return splitSize;
}
public void setSplitSize(String x){
splitSize = x;
}
public String getDlrStatus(){
return dlrStatus;
}
public void setDlrStatus(String x){
dlrStatus = x;
}
public String getSiteName(){
return siteName;
}
public void setSiteName(String x){
siteName = x;
}
public String getStoreNum(){
return storeNum;
}
public void setStoreNum(String x){
storeNum = x;
}
public String getPortRange(){
return portRange;
}
public void setPortRange(String x){
portRange = x;
}
public String getNonEra(){
return nonEra;
}
public void setNonEra(String x){
nonEra = x;
}
public String getNonEraSub(){
return nonEraSub;
}
public void setNonEraSub(String x){
nonEraSub = x;
}
public String getDlrName(){
return dlrName;
}
//alvinoh ins start
public void setCrashBook(String x){
crashbook = x;
}
public String getCrashBook(){
return crashbook;
}
public void setAltCrashBook(String x){
altcrashbook = x;
}
public String getAltCrashBook(){
return altcrashbook;
}
//alvinoh ins end
//05ckw ins start
public boolean getViewPack(){
return viewPack;
}
public boolean getViewBranchInq(){
return viewBranchInq;
}
public boolean getViewTaxCode(){
return viewTaxCode;
}
public boolean getViewDetail(){
return viewDetail;
}
public boolean getViewRemarks(){
return viewRemarks;
}
public boolean getViewClass(){
return viewClass;
}
public boolean getViewMdlAppl(){
return viewMdlAppl;
}
public boolean getViewSalesHist(){
return viewSalesHist;
}
public boolean viewMasterInq(){
if(viewPack || viewTaxCode || viewDetail || viewRemarks || viewClass
|| viewMdlAppl || viewSalesHist || viewBranchInq) return true;
return false;
}
public void setViewPack(boolean x){
this.viewPack = x;
}
public void setViewBranchInq(boolean x){
this.viewBranchInq = x;
}
public void setViewTaxCode(boolean x){
this.viewTaxCode = x;
}
public void setViewDetail(boolean x){
this.viewDetail = x;
}
public void setViewRemarks(boolean x){
this.viewRemarks = x;
}
public void setViewClass(boolean x){
this.viewClass = x;
}
public void setViewMdlAppl(boolean x){
this.viewMdlAppl = x;
}
public void setViewSalesHist(boolean x){
this.viewSalesHist = x;
}
//05ckw ins end
public void setDlrName(String x){
dlrName = x;
}
public String getDlrAddress(){
return dlrAddress;
}
public void setDlrAddress(String x){
dlrAddress = x;
}
public String getDlrSuburb(){
return dlrSuburb;
}
public void setDlrSuburb(String x){
dlrSuburb = x;
}
public String getDlrState(){
return dlrState;
}
public void setDlrState(String x){
dlrState = x;
}
public String getDlrPostcode(){
return dlrPostcode;
}
public void setDlrPostcode(String x){
dlrPostcode = x;
}
public String getDlrPhone(){
return dlrPhone;
}
public void setDlrPhone(String x){
dlrPhone = x;
}
public String getDlrFax(){
return dlrFax;
}
public void setDlrFax(String x){
dlrFax = x;
}
public String getDlrEmail(){
return dlrEmail;
}
public void setDlrEmail(String x){
dlrEmail = x;
}
public String getDlrMakeID(){
return dlrMakeID;
}
public void setDlrMakeID(String x){
dlrMakeID = x;
}
public String getCreateDate(){
return createDate;
}
public void setCreateDate(String x){
createDate = x;
}
public String getDlrComments(){
return dlrComments;
}
public void setDlrComments(String x){
dlrComments = x;
}
public String getPricingPortRange(){
return pricingPortRange;
}
public void setPricingPortRange(String x){
pricingPortRange = x;
}
public int getStartPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
int startPort = Integer.parseInt(st.nextToken());
return startPort;
}
public int getDefaultPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
String temp = st.nextToken();
temp = st.nextToken();
int defaultPort = Integer.parseInt(st.nextToken());
return defaultPort;
}
public int getEndPort(){
StringTokenizer st = new StringTokenizer(portRange,"^");
String temp = st.nextToken();
int endPort = Integer.parseInt(st.nextToken());
return endPort;
}
public int getPricingStartPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
int startPort = Integer.parseInt(st.nextToken());
return startPort;
}
public int getPricingDefaultPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
String temp = st.nextToken();
temp = st.nextToken();
int defaultPort = Integer.parseInt(st.nextToken());
return defaultPort;
}
public int getPricingEndPort(){
StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
String temp = st.nextToken();
int endPort = Integer.parseInt(st.nextToken());
return endPort;
}
public String getIsDistributor(){
return isDistributor;
}
public void setIsDistributor(String x){
isDistributor = x;
}
public String getEraVersion(){
return eraVersion;
}
public void setEraVersion(String x){
eraVersion = x;
}
public String getSearchType(){
return searchType;
}
public void setSearchType(String x){
searchType = x;
}
public java.sql.Date getSUploadDate(){
return SuploadDate;
}
public void setSUploadDate( java.sql.Date x ){
SuploadDate = x;
}
public java.util.Date getJUploadDate(){
return JuploadDate;
}
public void setJUploadDate( java.util.Date x ){
JuploadDate = x;
}
public String getShowLookup(){
return showLookup;
}
public void setShowLookup(String x){
showLookup = x;
}
public java.sql.Date getSCreateDate(){
return ScreateDate;
}
public void setSCreateDate( java.sql.Date x ){
ScreateDate = x;
}
public java.util.Date getJCreateDate(){
return JcreateDate;
}
public void setJCreateDate( java.util.Date x ){
JcreateDate = x;
}
public void setSelectTransCode(boolean selectTransCode){
this.selectTransCode = selectTransCode;
}
public boolean getSelectTransCode(){
return selectTransCode;
}
public void setViewSource(boolean viewSource){
this.viewSource = viewSource;
}
public boolean getViewSource(){
return viewSource;
}
public String getEmailOrder(){
return emailOrder;
}
public void setEmailOrder(String x){
emailOrder = x;
}
public String getDlrCode(){
return dlrCode;
}
public void setDlrCode(String x){
dlrCode = x;
}
//04ckw start
public boolean getFactoryInq(){
return factoryInq;
}
public void setFactoryInq(boolean factoryInq){
this.factoryInq = factoryInq;
}
//04ckw end
public void setDlrPartsManager(String x){
dlrPartsManager = x;
}
public String getDlrPartsManager(){
return dlrPartsManager;
}
public Vector getAttachedUsers() throws SQLException {
return retrieveAttachedUsers(siteID, Integer.parseInt(countryID));
}
// this function returns true if the site is a dealer.partsales
parent site
public boolean isParent() throws SQLException {
DealerGroupRecord dgr = new DealerGroupRecord();
return dgr.isParent(siteID, Integer.parseInt(countryID));
}
/** 06ckw ins start
This method has to be fixed, at the moment only used for toyota tsusho
*/
public boolean viewCasePartSearch(){
if(siteID.equals("1065") || siteID.equals("1064")){
return true;
}
return false;
}
//function to return a string representation of a user record
public String toString () {
String recordString = "";
recordString = siteID + " " + siteName + " " + storeNum + " " +
splitSize + " " + portRange + " " + nonEra + " "
+ dlrStatus + " " + dlrName + " " + dlrAddress + " " + dlrSuburb +
" " + dlrState + " " + dlrPostcode + " "
+ dlrPhone + " " + dlrFax + " " + dlrEmail + " " + dlrMakeID + " "
+ createDate + " " + dlrComments + " " + countryID + " " +
pricingPortRange + " " + isDistributor + " " + nonEraSub + " " +
eraVersion + " " + showLookup + " " + searchType + " " + lastUpload +
" " + viewSource + " " + selectTransCode + " " + emailOrder + " " +
dlrCode + " " + dlrPartsManager + " " + factoryInq + " " + batchflag +
" " + batchusername + " " +
batchpassword + " " + batchhome + " " + batchemail + " " +
batchhome2;
return recordString;
}
private void retrieveSiteRecord(String siteID, int countryID) throws
SQLException, Exception {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_ID = " + siteID
+ " ORDER BY DLR_NAME";
message = sqlString;
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = siteID;
siteName = rs.getString("SITE_NAME");
storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
ScreateDate = rs.getDate("CREATE_DATE");
JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
searchType = rs.getString("SEARCH_TYPE");
lastUpload = rs.getString("LAST_UPLOAD") ;
SuploadDate = rs.getDate("LAST_UPLOAD") ;
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
JuploadDate = SuploadDate!=null?SuploadDate.valueOf(SuploadDate.toString()):null;
//not sure if this is the best way to do this
viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist\n<br>--> In
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord:
while retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
private void retrieveSiteRecord(String siteName,String
storeNum,String dlrMakeID, int countryID) throws Exception,
SQLException {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
siteName
+ "\' AND STORE_NUM = \'" + storeNum + "\' AND
DLR_MAKE_ID = \'" + dlrMakeID + "\'"
+ " ORDER BY DLR_NAME ";
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = rs.getString("SITE_ID");
this.siteName = rs.getString("SITE_AME");
this.storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
this.dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
dlrComments = rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
searchType = rs.getString("SEARCH_TYPE");
lastUpload = rs.getString("LAST_UPLOAD");
viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
//this retrieves the first record with passed nodeID
private void retrieveSiteRecord(String nodeID) throws SQLException,
Exception {
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
this.countryID = ContextServlet.getApplParameter("countryID");
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
stmt = con.createStatement();
sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
nodeID + "\'";
message = sqlString;
rs = stmt.executeQuery(sqlString);
if ( rs.next() ){
this.siteID = rs.getString("SITE_ID");
siteName = rs.getString("SITE_NAME");
storeNum = rs.getString("STORE_NUM");
splitSize = rs.getString("SPLIT_SIZE");
portRange = rs.getString("PORT_RANGE");
pricingPortRange = rs.getString("PRICING_PORT_RANGE");
nonEra = rs.getString("NON_ERA");
nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
dlrStatus = rs.getString("DLR_STATUS");
dlrName = rs.getString("DLR_NAME");
dlrAddress = rs.getString("DLR_ADDR");
dlrSuburb = rs.getString("DLR_SUBURB");
dlrState = rs.getString("DLR_STATE");
dlrPostcode = rs.getString("DLR_POSTCODE");
dlrPhone = rs.getString("DLR_PHONE");
dlrFax = rs.getString("DLR_FAX");
dlrEmail = rs.getString("DLR_EMAIL");
dlrMakeID = rs.getString("DLR_MAKE_ID");
createDate = rs.getString("CREATE_DATE");
ScreateDate = rs.getDate("CREATE_DATE");
JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
isDistributor = rs.getString("IS_DISTRIBUTOR");
eraVersion = rs.getString("ERA_VERSION");
showLookup = rs.getString("VIEW_LOOKUP");
lastUpload = rs.getString("LAST_UPLOAD") ;
SuploadDate = rs.getDate("LAST_UPLOAD") ;
if(SuploadDate != null){
JuploadDate = SuploadDate.valueOf(SuploadDate.toString()); //not
sure if this is the best way to do this
}else{
JuploadDate = null;
} viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
emailOrder = rs.getString("EMAIL_ORDER_ID");
dlrCode = rs.getString("DLR_CODE");
dlrPartsManager = rs.getString("PARTS_MANAGER");
this.countryID = rs.getString("COUNTRY_ID");
factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
batchflag = rs.getString("BATCH_FLAG");
batchusername = rs.getString("BATCH_USERNAME");
batchpassword = rs.getString("BATCH_PASSWORD");
batchhome = rs.getString("BATCH_HOME");
batchhome2 = rs.getString("HOME_DIRECTORY");
batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
//alvinchanges start
crashbook = rs.getString("VIEW_CRASHBOOK");
altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end
} else {
throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
}
private Vector retrieveAttachedUsers(String siteID, int countryID)
throws SQLException {
Vector attachedUsers = new Vector();
String sqlString = "";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
sqlString = "SELECT USER_ID FROM USER_DEALERS WHERE SITE_ID = " +
siteID ;
rs = stmt.executeQuery(sqlString);
while ( rs.next() ){
attachedUsers.addElement(rs.getString("USER_ID"));
}
} finally {
try {
rs.close();
} catch (Exception e){}
try {
stmt.close();
} catch (Exception e){}
try {
con.close();
} catch (Exception e){}
}
return attachedUsers;
}
// validates user entered data
private void testVariables () throws IncompleteFormDataException,
IncompleteDataException {
// user/programmer errors
if (storeNum.equals("")){ throw new
IncompleteFormDataException("Store Number is a required field"); }
if (portRange.equals("")) { throw new
IncompleteFormDataException("Port Range is a required field"); }
if (dlrName.equals("")) { throw new
IncompleteFormDataException("Dealer Name is a required field"); }
if (dlrState.equals("")) { throw new
IncompleteFormDataException("Dealer State is a required field"); }
if (dlrEmail.equals("")) { throw new
IncompleteFormDataException("Dealer Email is a required field"); }
if (dlrMakeID.equals("")) { throw new
IncompleteFormDataException("Dealer Make ID is a required field"); }
if (nonEra.equals("")) { throw new IncompleteFormDataException("Non
Era is a required field"); }
if (splitSize.equals("")) { throw new
IncompleteFormDataException("Split size is a required field"); }
if (dlrStatus.equals("")) { throw new
IncompleteFormDataException("Dealer status is a required field"); }
}
public void dealerInsert(int countryID) throws SQLException,
IncompleteFormDataException, IncompleteDataException,
DealerAlreadyExistsException
{
Connection con = null;
Statement stmt = null;
String stmtString = "";
SQLFormatter sf = new SQLFormatter();
this.countryID = new Integer(countryID).toString();
testVariables();
retrieveSiteID(countryID);
try{
con = PartsalesOracleConnection.getConnection(countryID);
con.setAutoCommit(false);
stmt = con.createStatement();
stmtString = "INSERT INTO REMOTE_SITES "
+ "(SITE_ID, "
+ " SITE_NAME, "
+ " STORE_NUM, "
+ " SPLIT_SIZE, "
+ " PORT_RANGE, "
+ " NON_ERA,"
+ " DLR_STATUS, "
+ " DLR_NAME, "
+ " DLR_ADDR, "
+ " DLR_SUBURB, "
+ " DLR_STATE, "
+ " DLR_POSTCODE,"
+ " DLR_PHONE, "
+ " DLR_FAX, "
+ " DLR_EMAIL, "
+ " DLR_MAKE_ID, "
+ " CREATE_DATE, "
+ " DLR_COMMENTS,"
+ " COUNTRY_ID, "
+ " PRICING_PORT_RANGE, "
+ " IS_DISTRIBUTOR, "
+ " NON_ERA_SUB, "
+ " ERA_VERSION, "
+ " VIEW_LOOKUP, "
+ " SEARCH_TYPE, "
+ " VIEW_SRC, "
+ " SEL_TC, "
+ " EMAIL_ORDER_ID, "
+ " DLR_CODE, "
+ " FACT_INQ, " // 04CKW ADD
+ " BATCH_FLAG, "
+ " BATCH_USERNAME, "
+ " BATCH_PASSWORD, "
+ " BATCH_EMAIL, "
+ " BATCH_HOME, "
+ " HOME_DIRECTORY, "
//05CKW INS START
+ " VIEW_PACK, "
+ " VIEW_SALES_HIST, "
+ " VIEW_REMARKS, "
+ " VIEW_DETAIL, "
+ " VIEW_CLASS, "
+ " VIEW_TAX_CODE, "
+ " VIEW_MDL_APPL, "
+ " VIEW_BRANCH_INQ, "
//05CKW INS END
//alvinoh INS START
+ " VIEW_CRASHBOOK, "
+ " VIEW_ALT_CRASHBOOK, "
//alvinoh INS END
+ " PARTS_MANAGER)"
+ " VALUES ("
+ siteID + ","
+ "'" + siteName + "',"
+ "'" + storeNum + "',"
+ splitSize + ","
+ "'" + portRange + "',"
+ "'" + nonEra + "',"
+ dlrStatus + ","
+ "'" + sf.format(dlrName) + "',"
+ "'" + sf.format(dlrAddress) + "',"
+ "'" + sf.format(dlrSuburb) + "',"
+ "'" + dlrState + "',"
+ "'" + dlrPostcode + "',"
+ "'" + dlrPhone + "',"
+ "'" + dlrFax + "',"
+ "'" + dlrEmail + "',"
+ "'" + dlrMakeID + "',"
+ "CURRENT TIMESTAMP,"
+ "'" + sf.format(dlrComments) + "',"
+ countryID + ","
+ "'" + pricingPortRange + "',"
+ "'" + isDistributor + "',"
+ "'" + nonEraSub + "',"
+ "'" + eraVersion +"',"
+ "'" + showLookup +"',"
+ searchType + ","
+ "'" + (new Boolean(viewSource)).toString() + "',"
+ "'" + (new Boolean(selectTransCode)).toString() + "',"
+ "'" + emailOrder + "',"
+ "'" + dlrCode + "',"
+ "'" + (new Boolean(factoryInq)).toString() + ","
+ "'" + batchflag + "',"
+ "'" + batchusername + "',"
+ "'" + batchpassword + "',"
+ "'" + batchemail + "',"
+ "'" + batchhome + "',"
+ "'" + batchhome2 + "',"
//05CKW INS START
+ "'" + viewPack + "',"
+ "'" + viewSalesHist + "',"
+ "'" + viewRemarks + "',"
+ "'" + viewDetail + "',"
+ "'" + viewClass + "',"
+ "'" + viewTaxCode + "',"
+ "'" + viewMdlAppl + "',"
+ "'" + viewBranchInq + "',"
//05CKW INS END
//alvinoh INS START
+ "'" + crashbook + "',"
+ "'" + altcrashbook + "',"
//alvinoh INS END
+ "'" + dlrPartsManager + "')";
stmt.executeUpdate(stmtString);
// update log_sites
stmtString = "INSERT INTO LOG_SITES (SITE_ID, SITE_STATUS,
DATE_MOD)"
+ " VALUES (" + siteID + "," + dlrStatus + ",CURRENT
TIMESTAMP)";
stmt.executeUpdate(stmtString);
//commit changes to database
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
try {
con.rollback();
con.setAutoCommit(true);
} catch (Exception ex){}
if (e.getErrorCode() == 1){
throw new DealerAlreadyExistsException ("This dealer already
exists");
}
throw new SQLException (e.toString() + "<br>--> " + stmtString);
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
public void delete() throws SQLException, IncompleteFormDataException
{
Connection con = null;
Statement stmt = null;
String stmtString = "";
if (!dealerPopulated){
throw new IncompleteFormDataException("getUserDetails() method not
called");
}
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
con.setAutoCommit(false);
stmt = con.createStatement();
stmt.executeUpdate("DELETE FROM REMOTE_SITES WHERE SITE_ID = " +
siteID );
stmt.executeUpdate("DELETE FROM USER_DEALERS WHERE SITE_ID = " +
siteID);
stmt.executeUpdate("DELETE FROM DEALER_GROUPS WHERE SITE_ID = " +
siteID);
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
con.rollback();
con.setAutoCommit(true);
throw e;
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
private void retrieveSiteID(int countryID) throws SQLException {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try{
con = PartsalesOracleConnection.getConnection(countryID);
stmt = con.createStatement();
String stmtString = "SELECT NEXTVAL FOR SITE_ID_SEQ FROM
RNRDB2.DUAL";
rs = stmt.executeQuery(stmtString);
rs.next();
siteID = rs.getString("1");
rs.close();
stmt.close();
con.close();
} finally {
try { rs.close(); }
catch (Exception e) {}
try { stmt.close(); }
catch (Exception e) {}
try { con.close(); }
catch (Exception e) {}
}
}
public void dealerUpdate() throws IncompleteFormDataException,
IncompleteDataException , SQLException {
Connection con = null;
Statement stmt = null;
String stmtString = "";
SQLFormatter sf = new SQLFormatter();
// A call to getUserDetails() must be made before updating user
if (!dealerPopulated){
throw new IncompleteFormDataException("retrieveSiteRecord() method
not called");
}
testVariables();
// fix any variables that might possible have apostrophes in them
try {
con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
con.setAutoCommit(false);
stmt = con.createStatement();
updateStmt = "UPDATE REMOTE_SITES SET";
addSQL("SITE_NAME", "'" + siteName + "'");
addSQL("STORE_NUM", "'" + storeNum + "'");
addSQL("SPLIT_SIZE", splitSize);
addSQL("PORT_RANGE", "'" + portRange + "'");
addSQL("NON_ERA", "'" + nonEra + "'");
addSQL("DLR_STATUS", dlrStatus);
addSQL("DLR_NAME", "'" + sf.format(dlrName)+ "'");
addSQL("DLR_ADDR", "'" + sf.format(dlrAddress)+ "'" );
addSQL("DLR_SUBURB", "'" + sf.format(dlrSuburb)+ "'");
addSQL("DLR_STATE", "'" + dlrState + "'");
addSQL("DLR_POSTCODE", "'" + dlrPostcode + "'");
addSQL("DLR_PHONE", "'" + dlrPhone + "'");
addSQL("DLR_FAX", "'" + dlrFax + "'");
addSQL("DLR_EMAIL", "'" + dlrEmail + "'");
addSQL("DLR_MAKE_ID", "'" + dlrMakeID + "'");
addSQL("DLR_COMMENTS", "'" + sf.format(dlrComments) + "'");
addSQL("COUNTRY_ID", countryID);
addSQL("PRICING_PORT_RANGE", "'" + pricingPortRange + "'");
addSQL("IS_DISTRIBUTOR", "'" + isDistributor + "'");
addSQL("NON_ERA_SUB", "'" + nonEraSub + "'");
addSQL("ERA_VERSION","'" + eraVersion + "'");
addSQL("VIEW_LOOKUP","'" + showLookup + "'");
addSQL("SEARCH_TYPE", searchType);
addSQL("VIEW_SRC", "'" + (new Boolean(viewSource)).toString() +
"'");
addSQL("SEL_TC","'" + (new Boolean(selectTransCode)).toString() +
"'");
addSQL("EMAIL_ORDER_ID", "'" + emailOrder + "'");
addSQL("DLR_CODE", "'" + dlrCode + "'");
addSQL("PARTS_MANAGER", "'" + dlrPartsManager + "'");
addSQL("FACT_INQ", "'" + (new Boolean(factoryInq)).toString() +
"'");
addSQL("BATCH_FLAG","'" + batchflag + "'");
addSQL("BATCH_USERNAME","'" + batchusername + "'");
addSQL("BATCH_PASSWORD","'" + batchpassword + "'");
addSQL("BATCH_EMAIL","'" + batchemail + "'");
addSQL("BATCH_HOME","'" + batchhome + "'");
addSQL("HOME_DIRECTORY","'" + batchhome2 + "'");
//05CKW INS START
addSQL("VIEW_PACK","'" + viewPack + "'");
addSQL("VIEW_DETAIL","'" + viewDetail + "'");
addSQL("VIEW_REMARKS","'" + viewRemarks + "'");
addSQL("VIEW_CLASS","'" + viewClass + "'");
addSQL("VIEW_SALES_HIST","'" + viewSalesHist + "'");
addSQL("VIEW_TAX_CODE","'" + viewTaxCode + "'");
addSQL("VIEW_MDL_APPL","'" + viewMdlAppl + "'");
addSQL("VIEW_BRANCH_INQ","'" + viewMdlAppl + "'");
//05CKW INS END
//alvinoh INS START
addSQL("VIEW_CRASHBOOK","'" + crashbook + "'");
addSQL("VIEW_ALT_CRASHBOOK","'" + altcrashbook + "'");
//alvinoh INS END
updateStmt += " WHERE SITE_ID = " + siteID;
stmt.executeUpdate(updateStmt);
con.commit();
con.setAutoCommit(true);
} catch (SQLException e) {
try {
con.rollback();
con.setAutoCommit(true);
} catch (Exception ex) {}
throw new SQLException (e.toString() + "<br>\n---> Copy And Paste
following statement and send to (e-mail address removed)<br>\n" +
updateStmt);
} finally {
try { stmt.close(); }
catch (Exception e){}
try { con.close(); }
catch (Exception e){}
}
}
public void addSQL(String column, String value) {
// If value does not equal null then add to updateStmt
if (value!=null) {
if (updateStmt.equals("UPDATE REMOTE_SITES SET")) { updateStmt += "
" + column + " = " + value ; }
else { updateStmt += " ," + column + " = " + value ; }
}
}
public boolean backupRunning(int countryID) throws
ConnectionException,SQLException,InvalidGroupException{
boolean backupRunning = false;
// this.countryID = ContextServlet.getApplParameter("countryID");
// 07ckw del if (!(new
DealerGroupRecord(siteID,countryID)).getParent().equals("7") && !(new
DealerGroupRecord(siteID,countryID)).getParent().equals("113"))
//07ckw ins start
if ((new DealerGroupRecord(siteID,countryID)).getParent().equals("1065")) {
//07ckw ins end
try
{
PartsalesConnection dealerConnection = new
PartsalesConnection(this,"dealerlink");
PickRecord pr = PickRecord.read("0","ERABACKUP","CONTROL.BACKUP",
"1", "R",dealerConnection,this.getStoreNum());
if (pr.getPickRecord().equalsIgnoreCase("Y")){
backupRunning = true;
}
}catch(ConnectionException ce){};
}
return backupRunning;
}
}
Is anyone able to decipher this for me?????