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() {}
}