Author: mbenson
Date: Fri Aug 1 10:43:24 2008
New Revision: 681761
URL: http://svn.apache.org/viewvc?rev=681761&view=rev
Log:
guard against null Blob
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?rev=681761&r1=681760&r2=681761&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java Fri Aug
1 10:43:24 2008
@@ -46,6 +46,7 @@
import java.util.StringTokenizer;
import java.util.Vector;
+import java.sql.Blob;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.SQLException;
@@ -810,7 +811,10 @@
private void printValue(ResultSet rs, int col, PrintStream out)
throws SQLException {
if (rawBlobs && rs.getMetaData().getColumnType(col) == Types.BLOB) {
- new StreamPumper(rs.getBlob(col).getBinaryStream(), out).run();
+ Blob blob = rs.getBlob(col);
+ if (blob != null) {
+ new StreamPumper(rs.getBlob(col).getBinaryStream(), out).run();
+ }
} else {
out.print(maybeQuote(rs.getString(col)));
}