/** * Returns the SQL statement with the current template values substituted. * * @return SQL statement with the current template values substituted */ public String toString() { if (preparedQuery == null) { return super.toString(); } return preparedQuery.query.toString(preparedParameters); }
public String toString() { if (preparedQuery == null) return super.toString(); return preparedQuery.toString(preparedParameters); }
private void parseQuery() { String l_sql = originalQuery.toString(null); StringTokenizer st = new StringTokenizer(l_sql, " \r\t\n"); boolean tableFound = false; boolean tablesChecked = false; String name = ""; singleTable = true; while (!tableFound && !tablesChecked && st.hasMoreTokens()) { name = st.nextToken(); if ("from".equalsIgnoreCase(name)) { tableName = st.nextToken(); if ("only".equalsIgnoreCase(tableName)) { tableName = st.nextToken(); onlyTable = "ONLY "; } tableFound = true; } } }
private void parseQuery() { String l_sql = originalQuery.toString(null); StringTokenizer st = new StringTokenizer(l_sql, " \r\t\n"); boolean tableFound = false, tablesChecked = false; String name = ""; singleTable = true; while ( !tableFound && !tablesChecked && st.hasMoreTokens() ) { name = st.nextToken(); if ( !tableFound ) { if ("from".equalsIgnoreCase(name)) { tableName = st.nextToken(); if ("only".equalsIgnoreCase(tableName)) { tableName = st.nextToken(); onlyTable = "ONLY "; } tableFound = true; } } else { tablesChecked = true; // if the very next token is , then there are multiple tables singleTable = !name.equalsIgnoreCase(","); } } }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }
@Override public void handleError(SQLException newError) { if (getException() == null) { Arrays.fill(updateCounts, committedRows, updateCounts.length, Statement.EXECUTE_FAILED); if (allGeneratedRows != null) { allGeneratedRows.clear(); } String queryString = "<unknown>"; if (resultIndex < queries.length) { queryString = queries[resultIndex].toString(parameterLists[resultIndex]); } BatchUpdateException batchException = new BatchUpdateException( GT.tr("Batch entry {0} {1} was aborted: {2} Call getNextException to see other errors in the batch.", resultIndex, queryString, newError.getMessage()), newError.getSQLState(), uncompressUpdateCount()); batchException.initCause(newError); super.handleError(batchException); } resultIndex++; super.handleError(newError); }
public String toString() { if (preparedQuery == null) return super.toString(); return preparedQuery.toString(preparedParameters); }
public String toString() { if (preparedQuery == null) return super.toString(); return preparedQuery.toString(preparedParameters); }
private void parseQuery() { String l_sql = originalQuery.toString(null); StringTokenizer st = new StringTokenizer(l_sql, " \r\t\n"); boolean tableFound = false, tablesChecked = false; String name = ""; singleTable = true; while ( !tableFound && !tablesChecked && st.hasMoreTokens() ) { name = st.nextToken(); if ( !tableFound ) { if ("from".equalsIgnoreCase(name)) { tableName = st.nextToken(); if ("only".equalsIgnoreCase(tableName)) { tableName = st.nextToken(); onlyTable = "ONLY "; } tableFound = true; } } else { tablesChecked = true; // if the very next token is , then there are multiple tables singleTable = !name.equalsIgnoreCase(","); } } }
private void parseQuery() { String l_sql = originalQuery.toString(null); StringTokenizer st = new StringTokenizer(l_sql, " \r\t\n"); boolean tableFound = false, tablesChecked = false; String name = ""; singleTable = true; while ( !tableFound && !tablesChecked && st.hasMoreTokens() ) { name = st.nextToken(); if ( !tableFound ) { if ("from".equalsIgnoreCase(name)) { tableName = st.nextToken(); if ("only".equalsIgnoreCase(tableName)) { tableName = st.nextToken(); onlyTable = "ONLY "; } tableFound = true; } } else { tablesChecked = true; // if the very next token is , then there are multiple tables singleTable = !name.equalsIgnoreCase(","); } } }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }
public void handleError(SQLException newError) { if (batchException == null) { int[] successCounts; if (resultIndex >= updateCounts.length) successCounts = updateCounts; else { successCounts = new int[resultIndex]; System.arraycopy(updateCounts, 0, successCounts, 0, resultIndex); } String queryString = "<unknown>"; if (resultIndex < queries.length) queryString = queries[resultIndex].toString(parameterLists[resultIndex]); batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), newError.getSQLState(), successCounts); } batchException.setNextException(newError); }