if (AdvancedSQLProps.FETCH_DIRECTION_FORWARD.equals(fetchDirectionProp)) {
this.fetchDirection = ResultSet.FETCH_FORWARD;
} else if (AdvancedSQLProps.FETCH_DIRECTION_REVERSE.equals(fetchDirectionProp)) {
this.fetchDirection = ResultSet.FETCH_REVERSE;
} else {
throw new DataServiceFault("Invalid fetch direction: " + fetchDirectionProp +
", valid values are {'" + AdvancedSQLProps.FETCH_DIRECTION_FORWARD +
"', '" + AdvancedSQLProps.FETCH_DIRECTION_REVERSE + "'}");
}
this.hasFetchDirection = true;
} else {
this.hasFetchDirection = false;
}
/* process fetch size */
String fetchSizeProp = props.get(RDBMS.FETCH_SIZE);
if (!DBUtils.isEmptyString(fetchSizeProp)) {
fetchSizeProp = fetchSizeProp.trim();
try {
this.fetchSize = Integer.parseInt(fetchSizeProp);
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid fetch size: " + fetchSizeProp +
", fetch size should be an integer");
}
this.hasFetchSize = true;
} else {
this.hasFetchSize = false;
}
/* process max field size */
String maxFieldSizeProp = props.get(RDBMS.MAX_FIELD_SIZE);
if (!DBUtils.isEmptyString(maxFieldSizeProp)) {
maxFieldSizeProp = maxFieldSizeProp.trim();
try {
this.maxFieldSize = Integer.parseInt(maxFieldSizeProp);
if (this.maxFieldSize <= 0) {
throw new DataServiceFault("Invalid maximum field size: " + maxFieldSizeProp +
", maximum field size should be a positive integer");
}
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid maximum field size: " + maxFieldSizeProp +
", maximum field size should be a positive integer");
}
this.hasMaxFieldSize = true;
} else {
this.hasMaxFieldSize = false;
}
/* process max rows */
String maxRowsProp = props.get(RDBMS.MAX_ROWS);
if (!DBUtils.isEmptyString(maxRowsProp)) {
maxRowsProp = maxRowsProp.trim();
try {
this.maxRows = Integer.parseInt(maxRowsProp);
if (this.maxRows <= 0) {
throw new DataServiceFault("Invalid maximum rows: " + maxRowsProp +
", maximum rows should be a positive integer");
}
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid maximum rows: " + maxRowsProp +
", maximum rows should be a positive integer");
}
this.hasMaxRows = true;
} else {
this.hasMaxRows = false;
}
/* process query timeout */
String queryTimeoutProp = props.get(RDBMS.QUERY_TIMEOUT);
if (!DBUtils.isEmptyString(queryTimeoutProp)) {
queryTimeoutProp = queryTimeoutProp.trim();
try {
this.queryTimeout = Integer.parseInt(queryTimeoutProp);
if (this.queryTimeout <= 0) {
throw new DataServiceFault("Invalid query timeout: " + queryTimeoutProp +
", query timeout be a positive integer");
}
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid query timeout: " + queryTimeoutProp +
", query timeout be a positive integer");
}
this.hasQueryTimeout = true;
} else {
this.hasQueryTimeout = false;
}
/* auto commit */
/* first check local auto commit setting */
String autoCommitProp = props.get(RDBMS.AUTO_COMMIT);
if (!DBUtils.isEmptyString(autoCommitProp)) {
autoCommitProp = autoCommitProp.trim();
try {
boolean acBool = Boolean.parseBoolean(autoCommitProp);
if (acBool) {
this.autoCommit = AutoCommit.AUTO_COMMIT_ON;
} else {
this.autoCommit = AutoCommit.AUTO_COMMIT_OFF;
}
} catch (Exception e) {
throw new DataServiceFault(e, "Invalid autocommit value: " + autoCommitProp +
", autocommit should be a boolean value");
}
} else {
/* global auto commit setting */
this.autoCommit = this.getConfig().getAutoCommit();