I am creating a BMP that insert different value into my database table . one of my database column is autonumber generation on insertion of other values into database .
I am getting EJBException in that identity not allowed .
pls respond me how to deal with autonumber in BMP.
regards
Vipin
-
Autonumber Generation in Entity Bean (6 messages)
- Posted by: Vipin Kumar
- Posted on: August 19 2001 06:24 EDT
Threaded Messages (6)
- Autonumber Generation in Entity Bean by Raghuram Ethirajan on August 19 2001 07:49 EDT
- Autonumber Generation in Entity Bean by Vipin Kumar on August 19 2001 10:20 EDT
- Autonumber Generation in Entity Bean by Ajith Narayan on August 20 2001 04:51 EDT
- Autonumber Generation in Entity Bean by Vipin Kumar on August 19 2001 10:20 EDT
- Autonumber Generation in Entity Bean by Robert Edison on August 20 2001 11:41 EDT
- Autonumber Generation in Entity Bean by Vipin Kumar on August 21 2001 07:47 EDT
- Autonumber Generation in Entity Bean by Pratap Das on August 25 2001 04:08 EDT
- Autonumber Generation in Entity Bean by Vipin Kumar on August 21 2001 07:47 EDT
-
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Raghuram Ethirajan
- Posted on: August 19 2001 07:49 EDT
- in response to Vipin Kumar
What do you mean by auto number generation? -
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Vipin Kumar
- Posted on: August 19 2001 10:20 EDT
- in response to Raghuram Ethirajan
its the same as sequence no in oracle . I am using SQL server as database and datatype of one of my column is Autonumber . -
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Ajith Narayan
- Posted on: August 20 2001 04:51 EDT
- in response to Vipin Kumar
What is sequence number in Oracle -
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Robert Edison
- Posted on: August 20 2001 11:41 EDT
- in response to Vipin Kumar
Can you post the finder method code? Looks like you have an incompatible type being returned for the primary key. -
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Vipin Kumar
- Posted on: August 21 2001 07:47 EDT
- in response to Robert Edison
My code is as follows
public interface QuestionsHome extends EJBHome{
public Questions create(String question_desc,String ans_option, String difficulty_level, String skills_id, String updated_by) throws RemoteException,CreateException;
public Questions findByPrimaryKey(String question_id)throws RemoteException,FinderException;
}
public String ejbFindByPrimaryKey(String qid) throws FinderException
{
try
{
Connection cn=null;
InitialContext ctx = new InitialContext();
javax.sql.DataSource ds =(javax.sql.DataSource) ctx.lookup("ACESPool");
cn = ds.getConnection();
System.out.println("Connected to Database");
Statement st = cn.createStatement();
ResultSet result = st.executeQuery("SELECT * FROM ACES_QUESTIONS_MASTER WHERE QUESTION_ID=" + qid);
if(result.next())
return(qid);
else
return(null);
}catch (Exception e)
{
e.printStackTrace();
return(null);
}
}
}
-
Autonumber Generation in Entity Bean[ Go to top ]
- Posted by: Pratap Das
- Posted on: August 25 2001 04:08 EDT
- in response to Vipin Kumar
Your findByPrimaryKey & ejbFindByPrimaryKey return values don't match - one is "Questions" & the other is "String".
--Das