Made loading of blobs from database more robust (#3895)
Signed-off-by: mpe85 <marco.perazzo85@gmail.com>
This commit is contained in:
parent
a38ac923ac
commit
bb639817a3
|
@ -27,6 +27,7 @@ import java.sql.Driver;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.sql.SQLFeatureNotSupportedException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
|
@ -164,9 +165,17 @@ public class DatabaseAdaptor
|
||||||
return new ByteArrayInputStream(bytes);
|
return new ByteArrayInputStream(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
Blob blob = result.getBlob(columnName);
|
Blob blob = result.getBlob(columnName);
|
||||||
return blob.getBinaryStream();
|
return blob.getBinaryStream();
|
||||||
}
|
}
|
||||||
|
catch (SQLFeatureNotSupportedException ex)
|
||||||
|
{
|
||||||
|
byte[] bytes = result.getBytes(columnName);
|
||||||
|
return new ByteArrayInputStream(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEmptyStringNull()
|
public boolean isEmptyStringNull()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue