Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajustar persistencia de campos CLOB cuando existen valores null #190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions src/main/java/org/replicadb/manager/OracleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ public int insertDataToTable(ResultSet resultSet, int taskId) throws SQLExceptio
break;
case Types.CLOB:
Clob clobData = resultSet.getClob(i);
//ps.setClob(i, clobData);
if (clobData != null)
{
//Se establece los datos del campo CLOB como un objeto java.io.Reader
ps.setClob(i, clobData.getCharacterStream());
clobData.free();
}
else//si el dato es null en el campo CLOB, se setea directamente el clobData
ps.setClob(i, clobData);
break;
case Types.BOOLEAN:
ps.setBoolean(i, resultSet.getBoolean(i));
Expand Down Expand Up @@ -211,7 +212,7 @@ public int insertDataToTable(ResultSet resultSet, int taskId) throws SQLExceptio
ps.setObject(i, resultSet.getObject(i),Types.STRUCT);
break;
default:
ps.setString(i, resultSet.getString(i));
ps.setObject(i, resultSet.getObject(i));//Cambiar getString por getObject para los tipos de dato ANYDATA
break;
}
}
Expand Down
Loading