ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r681761 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Date Fri, 01 Aug 2008 17:43:25 GMT
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)));
         }



Mime
View raw message