Adrian Pang

Ranch Hand
+ Follow
since Feb 20, 2004
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adrian Pang


I'm a Hibernate newbie and I've a simple dumb question: I'm trying to construct a HQL statement for searching a database string field. What I want is kind of like:

select from ContactName as n where like attern%

so if the pattern is 'a', I get all the contacts whose name start with an A, for example. However, I can't seem to get this to work -- what's the correct syntax for this? I also tried to add % in the pattern string directly, but that doesn't work neither.

Thanks a lot!!!

I passed the SCBCD yesterday with 91% (64/70). For me, the SCBCD exam is more difficult than SCWCD and SCJP -- because I have little experience (I never developed real-life applications using EJB before, only practice ones) and there's so much memorization which I am not good at (primkey-class? prim-key-class? primkey-field? prim-key-field?)

I read the HFEJB book (which is great), the spec. I did the HF mock exam (78%), jdiscuss (average 80%), jpilot (85%) and ejbcertificate (80%). I also asked and read lots of questions on the forum here.

Thanks guys!
17 years ago
JPilot question ID 1840:

A client has just called a business method on an entity bean on which another client has already called theBean.remove(). What will happen?


Select 1 correct option.

1. A new entity bean is created and the method is executed on that bean.
2. The method call will return immediately without returning any output.
3. The client will get javax.ejb.EJBException
4. The container will route the call to another container within the cluster (if it exists).
5. The client will get javax.ejb.NoSuchObjectLocalException if it is a local client.

Correct answer is 5.

I know the reason it should be 5, but 3 sounds correct as well -- after all, (if I understand correctly) the container does not have to throw the most specific exception to the user. If I see this question on the exam, I will pick 5 (since it's the best answer) but if the question has 2 answers, would it be wrong to pick 3 as well?

how about something like this in your bean:

if (env entry is true) {
} else {

then, the value of the env entry customizes the behaviour of the bean...
Since the question said there are 2 true statements, what's the other correct statement?

I would guess b...

I know there is no requirement that one must pass SCBCD before taking SCEA, but is it a good idea? Basically, I would like to take the SCEA as soon as possible, but I have not taken or prepared for SCBCD yet. I passed SCJP and SCWCD with quite good results, and I am thinking of taking Sun's certification acceleration package for SCEA, but I am worried that my knowledge of EJBs might be a bit weak and I am worried that my industry knowledge is also not very strong. Normally I would delay taking SCEA until I have more experience with the technology, but there's an opportunity for me right now to get sponsorship on taking SCEA (but not SCBCD) so I am considering changing my plans.

Any advices?

In my opinion (which might not be right), EL is much "simplified" because it hides ugly details from you. In your example, product can be a bean, or it can be a map... it can reside in page, request, session or application scope; all these have to be handled if you are using a JSP expression.
Thanks! I don't know -- maybe be SCBCD, or perhaps I'll learn some .NET and C#... take a break from Java
18 years ago
SCJP is properly a better forum for this post, but the variable is available for GC as soon as there are no more reference to it. The a inside testB is gone with the instance of testB is gone; which is the case when the instance of TestA is gone; which is the case when testAll completes. After testAll, a and b are candidates for GC.
Yay! Finally passed. The exam, in my opinion, is much harder than SCJP. You really must understand the concepts and have a lot of practice working with the technology to do well. The exam focuses on "new" technologies such as EL and tag files, and I didn't do too well on those questions because I haven't practice with them as much as I ought to... =(
18 years ago
SCWCD doesn't "require" Tomcat, but Tomcat5 comes with JSP2.0 and Servlet 2.4 built in so is the best for SCWCD 1.4.

It might be too late now but I think they are the same.
I don't know what the context that paragraph comes from, but I think it means it's not enough that the class implements the interfaces, it also needs to be registered in the web.xml in order for the listener to work.