Skip to content

Commit

Permalink
add query to exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed May 5, 2009
1 parent ece90a7 commit eaa6786
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/java/cascading/jdbc/db/DBInputFormat.java
Expand Up @@ -77,7 +77,7 @@ protected class DBRecordReader implements RecordReader<LongWritable, T>
* @param split The InputSplit to read data for
* @throws SQLException
*/
protected DBRecordReader( DBInputSplit split, Class<T> inputClass, JobConf job ) throws SQLException
protected DBRecordReader( DBInputSplit split, Class<T> inputClass, JobConf job ) throws SQLException, IOException
{
this.inputClass = inputClass;
this.split = split;
Expand All @@ -86,7 +86,15 @@ protected DBRecordReader( DBInputSplit split, Class<T> inputClass, JobConf job )
statement = connection.createStatement( ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY );

//statement.setFetchSize(Integer.MIN_VALUE);
results = statement.executeQuery( getSelectQuery() );
String query = getSelectQuery();
try
{
results = statement.executeQuery( query );
}
catch( SQLException exception )
{
throw new IOException( "unable to execute select query: " + query, exception );
}
}

/**
Expand Down

0 comments on commit eaa6786

Please sign in to comment.