[
https://issues.apache.org/jira/browse/TUSCANY-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534404
]
Ron Gavlin commented on TUSCANY-1843:
-------------------------------------
Luciano,
You might also want to apply the following patch so that the tests compile on
JDK 1.4 as well. Is it possible for you to update the build for at least the
das-rdb module to use the JDK 1.4 compiler? This would hopefully catch problems
like this one.
Thanks,
- Ron
Index:
C:/development/working/1/tuscany-das/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DocumentsImagesData.java
===================================================================
---
C:/development/working/1/tuscany-das/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DocumentsImagesData.java
(revision 584194)
+++
C:/development/working/1/tuscany-das/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DocumentsImagesData.java
(working copy)
@@ -18,18 +18,15 @@
*/
package org.apache.tuscany.das.rdb.test.data;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
-import java.sql.Types;
-import javax.sql.rowset.serial.SerialBlob;
-
import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns;
public class DocumentsImagesData extends TestDataWithExplicitColumns {
@@ -60,8 +57,8 @@
imgBytes[i] = (byte)fileImgStream.read();
i++;
}
- SerialBlob serialBlob = new SerialBlob(imgBytes);
- ps.setBlob(3, serialBlob);
+ Blob blob = createBlob(imgBytes);
+ ps.setBlob(3, blob);
ps.execute();
ps.close();
}catch(IOException ioe){
@@ -69,4 +66,32 @@
throw new RuntimeException("Could not insert data for
Blob/Clob..Please check resources!"+ioe.getMessage());
}
}
+
+ private Blob createBlob(byte[] bytes)
+ {
+ Blob blob = null;
+ Class blobClazz;
+ try {
+ blobClazz = Class.forName(
+ "javax.sql.rowset.serial.SerialBlob", true,
Thread.currentThread().getContextClassLoader());
+ Constructor blobConstructor = blobClazz.getConstructor(new Class[]
{bytes.getClass()});
+ blob = (Blob) blobConstructor.newInstance(new Object[] {bytes});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ return blob;
+ }
+
}
> DAS should support JDK 1.4
> --------------------------
>
> Key: TUSCANY-1843
> URL: https://issues.apache.org/jira/browse/TUSCANY-1843
> Project: Tuscany
> Issue Type: Bug
> Components: Java DAS RDB
> Affects Versions: Java-DAS-Next
> Reporter: Ron Gavlin
> Assignee: Luciano Resende
> Fix For: Java-DAS-Next
>
>
> Java DAS RDB 1.0-incubating-beta2 does not work with JDK 1.4. Specifically,
> class ConnectionImpl.java uses the JDK5-only Boolean.parseBoolean() method.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]