-
1. Re: JBoss with Interbase problems.
sdedonatis Sep 6, 2001 4:08 PM (in response to pibakic)Hi,
I also have the same problem with blobs in CMP Beans(using jboss 2.2.2, interbase 6.01 and interclient 2.0), however i had some success when i want to store a large string in a BLOB SUB_TYPE TEXT using this mapping for the cmp-field in jaws.xml:
<sql-type>BLOB</sql-type>
<jdbc-type>JAVA_OBJECT</jdbc-type> -
2. Re: JBoss with Interbase problems.
pibakic Sep 7, 2001 5:05 AM (in response to pibakic)Thanks for your help, but a couple of questions;
Do you mean standard-jaws.xml? The type-mapping config file (Im fairly certain you must, can't think what else it would be).
Secondly, the <java-type> attribute is missing? I presume its a "String" but not really sure,
Thanks,
Pib. -
3. Re: JBoss with Interbase problems.
sdedonatis Sep 7, 2001 8:48 AM (in response to pibakic)no, i meant the jaws.xml file that is in the META-INF subdirectory with the jboss.xml and the ejb-jar.xml.
jboss uses this file to override the default mappings.
in this file you can specify a custom database mapping or the mapping of every bean.
in my jaws.xml is:
<?xml version="1.0" encoding="Cp1252"?>
java:/cywDS
<type-mapping>InterBase</type-mapping>
...
<enterprise-beans>
...
<ejb-name>FichaInterna</ejb-name>
<table-name>FichaInterna</table-name>
<create-table>false</create-table>
<cmp-field>
<field-name>propietario</field-name>
<column-name>propietario</column-name>
<sql-type>VARCHAR(255)</sql-type>
<jdbc-type>VARCHAR</jdbc-type>
</cmp-field>
<cmp-field>
<field-name>observaciones</field-name>
<column-name>observaciones</column-name>
<sql-type>BLOB</sql-type>
<jdbc-type>JAVA_OBJECT</jdbc-type>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
<column-name>id</column-name>
<sql-type>INTEGER</sql-type>
<jdbc-type>INTEGER</jdbc-type>
</cmp-field>
</enterprise-beans>
being the observaciones a public String field in the EBJ.
hope that help. -
4. Re: JBoss with Interbase problems.
sdedonatis Sep 7, 2001 11:15 AM (in response to pibakic)I think i found the glitch !
The problem is that the default container configuration standardjboss.xml has a <commit-option>A</commit-option>(that means caching the state).
I changed it to B (caching the state but making ejbload before) and it worked with a byte[] field stored in a BLOB column. I use it to store an image the database; so i made a container-configuration in jboss.xml and i use it only for the beans that have blob fields.
Although i haven't testet it thoughtfully. -
5. Re: JBoss with Interbase problems.
pibakic Sep 10, 2001 10:26 AM (in response to pibakic)Thanks mate, you are a genius! After changing this setting I have encountered no problems at all using JBoss with Interbase,
Thanks again for your help,
Pib. -
6. Re: JBoss with Interbase problems.
sbsenjboss Oct 12, 2001 5:18 AM (in response to pibakic)Hi,
I am new to JAVA, can any one help me.
I have a EJB class which I deploy in JBOSS with INTERBASE back end.
Now I establish the connection in the EJB class itself and call a Stored Procedure and convert the Result Set in to XML and receive in the client. There are many method in the EJB class do the same.
In order to get connection pooling.
What I have to add to
jboss.jcml
Do I need, What I have to add in this file
InterBasedb.properties
What I have to add to
jaws.xml
how I have to use this in my EJB class?
pl help me sample EJB class code is below
thanks in advance
sbsen.
*************************
public class AgentEJB implements SessionBean {
String jdbcURL = "jdbc:interbase://localhost/D:/Sportstech.gdb";
Connection conn;
Statement statement;
ResultSet resultSet;
ResultSetMetaData resultSetMetaData;
CallableStatement callableStatement;
Element output;
public AgentEJB(){
try{
Class.forName("interbase.interclient.Driver");
conn = DriverManager.getConnection(jdbcURL,"SYSDBA", "masterkey");
statement = conn.createStatement();
}
catch(Exception e){
e.printStackTrace();
}
}
public Element getDuplicateAgentCode(Element DuplicateAgentCode) {
try {
String astoredProcedure = "select * from SP_CHECKDUPLICATEAGENTCODE(?)";
callableStatement = conn.prepareCall(astoredProcedure);
callableStatement.setString(1, DuplicateAgentCode.getAttributeValue("VCAGENTCODE"));
resultSet = callableStatement.executeQuery();
this.getEJBElement(resultSet);
}
catch (SQLException se) {
se.printStackTrace();
}
return output;
}
/** Empty method body
*/
public void ejbCreate() {}
/** Empty method body
*/
public void ejbRemove(){}
/** Empty method body
*/
public void ejbActivate() {}
public void setSessionContext(SessionContext ctx) {}
public void ejbPassivate() {}
}