-
1. Re: usage of BLOB in JBoss 2.4.1 using MySQL
frankstolte Nov 9, 2001 2:53 PM (in response to imran)I'm using this in my standardjaws.xml
<java-type>java.lang.Object</java-type>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>BLOB</sql-type>
I have an entity bean with the two variables
public String name;
public ScanningValueObj scanningValueObj;
The first is the key and the second is a large object which gets stored by JBoss as a MEDIUMBLOB. I'm using CMP. Here is the standardjaws.xml part which creates the table in MySQL. The object is more then 64k in size that's why I'm usig mediumblob.
<ejb-name>Scanning</ejb-name>
<cmp-field>
<field-name>name</field-name>
<column-name>name</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(20)</sql-type>
</cmp-field>
<cmp-field>
<field-name>scanningValueObj</field-name>
<column-name>scanningValueObj</column-name>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>MEDIUMBLOB</sql-type>
</cmp-field>
Frank -
2. Re: usage of BLOB in JBoss 2.4.1 using MySQL
imran Nov 10, 2001 12:45 AM (in response to imran)Hi Frank
Thanx a lot for your reply. And indeed gave me some idea to get started on. But my question now is in the mechanism that you follow what is the "ScanningValueObj". Is it a class that implements the java.io.Serializable and implements the BLOB interface. Have you got any idea how JBOSS is going to interprit the "ScanningValueObj" as a BLOB to be stored in the DB. i.e How it would do the necessary insert/select queries. Please let me know about this, which i think should be good enough for me to get cracking on things.
TIA
Imran -
3. Re: usage of BLOB in JBoss 2.4.1 using MySQL
abrasax Feb 4, 2002 5:53 AM (in response to imran)Hi Imran,
did you get some answer to your last question? I have the same problem... If you (or somebody) know the answer, please can you post it here?
Thanx
Martin -
4. Re: usage of BLOB in JBoss 2.4.1 using MySQL
ben.alex Apr 19, 2002 3:35 AM (in response to imran)Hi there
I use a class like that described above called BlobHolder. It looks like this:
public class BlobHolder implements Serializable
{
public byte[] content;
}
I use a SQL type of BLOB/MEDIUMBLOB/LONGBLOG if I need 64Kb, 16Mb or 4096Mb maximum content sizes respectively with the JDBC type set to JAVA_OBJECT. It works fine.
Regards
Ben