sachin sachdeva

Greenhorn
+ Follow
since Mar 13, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by sachin sachdeva

This driver is a part of JDK1.2.2 (java.sql) so u dont have to do anything for this.Even u do not have to set any classpath,that u require for TYP-2 and TYPE-4 driver.
Hi To all
I was trying to test some basics on Transactions but i did not get any relevent output.
my Bean code

public void one() throws Exception
{
for(int i=1;i<=10;i++) Trans Att Required
{
pstmt.setInt(1,i);
pstmt.executeUpdate();
}
two();
three();
}
public void two() throws Exception Trans Att RequiresNew
{
for(int i=11;i<=20;i++)
{
pstmt.setInt(1,i);
pstmt.executeUpdate();
}
}

public void three() throws Exception
{ Trans Att Never
for(int i=21;i<=30;i++)
{
pstmt.setInt(1,i);
pstmt.executeUpdate();
Thread.sleep(50000);
}
}

jar File
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>TransBean</ejb-name>
<home>Trans.TransHome</home>
<remote>Trans.TransRemote</remote>
<ejb-class>Trans.TransBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>TransBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>one</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>TransBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>two</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>TransBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>three</method-name>
</method>
<trans-attribute>Never</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

Output
ouput is 1-30 in database
whereas i think it shuld be 1-20 after that TransactionNotSupportedException

Hi To all
I am trying to deploy an CMP by using Deployer Tool but it reqiures a Connection Pool name for the connectivity with Database so is it mandatory to have a connection pool can't we do it without that.
Thanx In Advance
Thanx Madhu
can u give me ur mail id if u dont mind i am having some more issues in the programs to be discussed.
Hi To all
Is any body can tell me that what is the return type of ejbCreate()
method in the case of CMP
in the some examples it is given as String or Primary Key Class and as a return statement they are returning null.
But in EdRoman it is given as void.
Pls tell me the answer with reason
Thanx in Advanve
Thanx Madhu
But Madhu i did the same then also it is giving the same problem By using Deployer Tool but yes manually i have done it actually i was doing a mistake that i have not specified Primary Key name
in the deployment descriptor . But how should i do it in the case of deployer tool.
Hi Niki
I think rather than .equals use ==
return((VProductPK)obj).productID.equals(productID);
Use This
return((VProductPK)obj).productID.==productID);
I think this will solve ur problem
Hi Nikita
i am expalining all the steps
suppose you are having a package BeanExample
within this directory create a directory structure for clearity
BeanExample
ejbclasses
Meta-INF
Compile ur classes in ejbclasses
BeanExample> javac -d ejbclasses *.java
BeanExample>jar -cvf temp.jar META-INF -C ejbclasses .
BeanExample>weblogic.ejbc temp.jar final.jar
In the First step it will compile the classes in ejbclasses
In the second step it will create a temporary jar
in the last step it will create the jar file to be deployed (Contains container classes)
Hi To all
I am trying to create a jar of Bean Managed Entity Beans.i tried it by Deployer Tool of Weblogic as well as manually.But it is giving the problem that no appropriate ejbFindByPrimaryKey() method found but i have declared ejbFindByPrimaryKey(PrimaryKeyClass obj) i have verified this with EdRoman's Example also but at the sun's site one example is given in which this methos is taking String parameters they dont have any primary key class everywhere they are using a String parameter .
So is Primary Key class is not mandatory or in the new Specs it does not required.
Pls Help Me

Thanx
Hi to all
I want to know that in which case we need to opt for Entity Beans.Like in the books it is given the example of Banking Applications but i need some more practical and satisfactory answer.
Thanx
whenever u are writing ur query write nvl method in that and replace null with any other value like space also.
Otherwise it will give you null pointer execption
Example
select nvl(empno,'') from emp
The main advantage of jsp is that it seprates the java code from HTML.Means if in the case of servlets even if u want to do some changes in HTML than that will be the resposibilty of java progrmmer because he needs to compile that file but in the case of jsp ur jsp code is seprates from HTML althoug internally it creates a servlet of that which stuff the html data in to java code.But programming point of view it becomes very very easy.
and if u know ASP than JSP is very easy for u even u can go through the chapter ASP to JSP
16 years ago
When we uses sendredirect then it does not passe the values to next page.For this either u can use forward or sendRedirect("uri+querystring)
Means by only querystring u can pass the values in sendRedirect
16 years ago