-
1. Re: Map Java byte[] to database BLOB ?
scoy Nov 8, 2002 6:29 AM (in response to ericmacau)1. Make sure that you have JBoss 3.0.4 (or newer)
2. Use these for the mappings:
<cmp-field>
<field-name>whatever</field-name>
<column-name>whatever</column-name>
<jdbc-type>BLOB</jdbc-type>
<sql-type>BLOB</sql-type>
</cmp-field>
This assumes that your database supports a BLOB data type - not all of them do. -
2. Re: Map Java byte[] to database BLOB ?
ericmacau Nov 10, 2002 11:20 PM (in response to ericmacau)Hi scoy,
Then what is the <java-type> ???
Bets regards,
Eric -
3. Re: Map Java byte[] to database BLOB ?
scoy Nov 11, 2002 1:41 AM (in response to ericmacau)You don't need the java type because you are specifying the specific entity and cmp field. The CMP implementation looks at your code and determines the type.
Steve -
4. Re: Map Java byte[] to database BLOB ?
viktor Nov 11, 2002 9:34 PM (in response to ericmacau)Does it work for you if you use 4K+ blobs? Oracle craches for me in the insert sataement issued by MP in JBoss. What's the secret?
-
5. Re: Map Java byte[] to database BLOB ?
scoy Nov 11, 2002 10:00 PM (in response to ericmacau)The secret is to use the OCI drivers.
See http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm for more details.
Steve -
6. Re: Map Java byte[] to database BLOB ?
viktor Nov 11, 2002 10:09 PM (in response to ericmacau)How do I configure oracle-service.xml to use OCI?
At the moment I have
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@192.168.5.23:1526:OR9I</config-property>
<config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
and use lates and greates classes12.jar for Oracle9i
Cheers -
7. Re: Map Java byte[] to database BLOB ?
scoy Nov 11, 2002 10:37 PM (in response to ericmacau)Here's one that works for me:
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:oci:@(description=(address=(host=ws94)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=sfcdell.whitesmiths.com.au)))</config-property>
<config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
Again, I encourage you to look at the URL I provided earlier. Also, it's a prerequisite to have Oracle client software installed on the JBoss host machine for this to work.
Regards,
Steve -
8. Re: Map Java byte[] to database BLOB ?
viktor Nov 12, 2002 7:16 PM (in response to ericmacau)Thanks for your help,
It is working for me just fine now. After doing that on Oracle9 I had to go back to Oracle8.16 which we use and it still works (with Oracle 9 client)!
Thanks again,
Viktor
Sorry if this message is a duplicate - something strange happens with JBoss site - it seems to kick me out of the log in state after few minutes timeout. -
9. Re: Map Java byte[] to database BLOB ?
jhang Nov 14, 2002 8:43 PM (in response to ericmacau)We're running JBoss on Linux here. Do you know if OCI drivers work with Linux? I guess the better question is if there is a Oracle client for Linux.