This may or may not help. I am assuming that you have a session bean
which has the create_entity_bean method()? What I do is something like
this....
public class MySession implements Session Bean {
private getConnection() throws SQLException, Naming Exception{
DataSource ds = (DataSource)
jndiContext.lookup("java:comp/env/jdbc/MyDB");
return ds.getConnection();
}
public MyPK createID(){
Connection con = getConnection(); //Connection Specific Method
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT MAX(ID+1)"); // Or use
any SQL you need to generate the ID
rs.next()
pk = new MyPk(rs.getInt(1));
stmt.close();
con.close();
return pk;
}
public MyPK createEntity(data1, data2, data3, data4) {
MyPK pk;
EntityHome.create(createID(), data1, data2, data3, data4);
return pk;
}
.
.
.
}
I just shot this one out of my ass so it is not compiled and will
probably not work right of the bat. I sent this to give you an idea of
what I do. : )
--
Dan Hinojosa
Java & Lotus Notes Consultant
Java Certified Programmer
P.O. Box 4675
Albuquerque, NM 87196-4675
Telephone: (505) 262-0911
Email: [EMAIL PROTECTED]
WWW: http://www.digitalpriest.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".