Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-03-11 15:08:37 -0400
committerEike Stepper2009-03-11 15:08:37 -0400
commit04ab084a7995a3303dc3b6e84d7d2c356614927b (patch)
tree38d913c57141c861a3d6568f97f9526d7b8e1541
parent1bc26cb09cf161b58b537c7cdbe422211b5c2e7a (diff)
downloadcdo-04ab084a7995a3303dc3b6e84d7d2c356614927b.tar.gz
cdo-04ab084a7995a3303dc3b6e84d7d2c356614927b.tar.xz
cdo-04ab084a7995a3303dc3b6e84d7d2c356614927b.zip
[265435] Replace CDOModelElements by EModelElements
https://bugs.eclipse.org/bugs/show_bug.cgi?id=265435
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
index 84ac92f5fd..7fe635e44d 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
@@ -21,6 +21,7 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import javax.sql.DataSource;
+import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@@ -384,7 +385,18 @@ public final class DBUtil
for (int i = 0; i < fields.length; i++)
{
values[i] = resultSet.getObject(i + 1);
- if (values[i] instanceof Clob)
+ if (values[i] instanceof Blob)
+ {
+ Blob blob = (Blob)values[i];
+ long length = blob.length();
+ if (length > Integer.MAX_VALUE)
+ {
+ throw new IllegalStateException("byte[] too long: " + length);
+ }
+
+ values[i] = blob.getBytes(1, (int)length);
+ }
+ else if (values[i] instanceof Clob)
{
Clob clob = (Clob)values[i];
long length = clob.length();

Back to the top