Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1372,13 +1372,16 @@ public void setBLOBFile(java.sql.Blob blob, String fileName) throws SQLException
{
if (fileName != null && !fileName.trim().equals("") && !fileName.toLowerCase().trim().endsWith("about:blank"))
{
if(con.getDBMS().getId() == GXDBMS.DBMS_ORACLE)
if(con.getDBMS().getId() == GXDBMS.DBMS_ORACLE || con.getDBMS().getId() == GXDBMS.DBMS_DAMENG)
{
try
{
File file = new File(fileName);
BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file));
((GXDBMSoracle7)con.getDBMS()).setBlobData(blob, inputStream, (int) file.length());
if(con.getDBMS().getId() == GXDBMS.DBMS_ORACLE)
((GXDBMSoracle7)con.getDBMS()).setBlobData(blob, inputStream, (int) file.length());
else
((GXDBMSdameng)con.getDBMS()).setBlobData(blob, inputStream, (int) file.length());
inputStream.close();
}
catch (Exception e)
Expand Down
6 changes: 3 additions & 3 deletions java/src/main/java/com/genexus/db/driver/GXResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ private String getBLOBFile(int columnIndex, String extension, String name, Strin
if (source != null)
{
firstByte = source.read(xbuffer);
if (con.getDBMS() instanceof GXDBMSoracle7)
if (con.getDBMS() instanceof GXDBMSoracle7 || con.getDBMS() instanceof GXDBMSdameng)
{
secondByte = source.read();
}
Expand All @@ -958,7 +958,7 @@ private String getBLOBFile(int columnIndex, String extension, String name, Strin
isEmptyBuffer = true;
}

if (result.wasNull() || source == null || firstByte == -1 || (con.getDBMS() instanceof GXDBMSoracle7 && secondByte == -1) || isEmptyBuffer)
if (result.wasNull() || source == null || firstByte == -1 || ((con.getDBMS() instanceof GXDBMSoracle7 || con.getDBMS() instanceof GXDBMSdameng) && secondByte == -1) || isEmptyBuffer)
{
if(source != null)
{
Expand All @@ -979,7 +979,7 @@ private String getBLOBFile(int columnIndex, String extension, String name, Strin
int bytes_read;

destination.write(xbuffer, 0, 1);
if (con.getDBMS() instanceof GXDBMSoracle7)
if (con.getDBMS() instanceof GXDBMSoracle7 || con.getDBMS() instanceof GXDBMSdameng)
{
destination.write(secondByte);
}
Expand Down