Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0001968: Oracle LONG types don't work when stream_to_lob is turned on
- Loading branch information
Showing
8 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
symmetric-jdbc/src/main/java/org/jumpmind/db/platform/oracle/OracleLobHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.jumpmind.db.platform.oracle; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import org.jumpmind.db.sql.JdbcUtils; | ||
import org.jumpmind.db.sql.SymmetricLobHandler; | ||
import org.springframework.jdbc.support.lob.DefaultLobHandler; | ||
|
||
@SuppressWarnings("deprecation") | ||
public class OracleLobHandler extends SymmetricLobHandler { | ||
|
||
DefaultLobHandler longHandler = new DefaultLobHandler(); | ||
|
||
public OracleLobHandler() { | ||
super(new org.springframework.jdbc.support.lob.OracleLobHandler()); | ||
((org.springframework.jdbc.support.lob.OracleLobHandler) lobHandler) | ||
.setNativeJdbcExtractor(JdbcUtils.getNativeJdbcExtractory()); | ||
} | ||
|
||
@Override | ||
public String getClobAsString(ResultSet rs, int columnIndex, int jdbcTypeCode, | ||
String jdbcTypeName) throws SQLException { | ||
if ("LONG".equalsIgnoreCase(jdbcTypeName)) { | ||
/** | ||
* Ironically, the Oracle Lob Handler doesn't handle the Oracle | ||
* specific data type of Long. We should probably swap out the | ||
* Oracle Lob Handler altogether but I haven't been able to get it | ||
* to insert Empty Clob Values appropriately yet. | ||
*/ | ||
return longHandler.getClobAsString(rs, columnIndex); | ||
} else { | ||
return super.getClobAsString(rs, columnIndex, jdbcTypeCode, jdbcTypeName); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters