Minu Jain

Ranch Hand
+ Follow
since Mar 24, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Minu Jain

Hi All,
I am using the ant installer in its Non-Extractor mode. I use the java -jar command to start the installer. After this the UI is displayed to the user.
What I want to do is execute a cp command, before the first UI page is displayed to the user.
Is there any way to do this? Or is it not possible in case of an ant installer?

Thanks in advance!
13 years ago
Hi All,
I am trying to run a query in the antinstaller using sqlplus. The query runs fine on sqldeveloper but the antinstaller gets stuck when trying to execute the query. Could anyone tell me what the problem could be? There are no errors, it is just stuck as follows:
[sqlplus]
[sqlplus] SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 7 16:00:00 2011
[sqlplus]
[sqlplus] Copyright (c) 1982, 2005, Oracle. All rights reserved.
[sqlplus]
[sqlplus]
[sqlplus] Connected to:
[sqlplus] Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
[sqlplus] With the Partitioning, OLAP and Data Mining options
[sqlplus]

Thanks in advance!
13 years ago
Hi All,
Can anyone please tell me whether the ojdbc6.jar comes packaged with oracle 10.2.0 (i.e. should ojdbc6.jar be in my ORACLE_HOME/jdbc/lib directory) ?

Thanks in advance!
13 years ago
Also, if instead I run the above script by directly typing the command on the prompt like this

source /opt/bea/wlserver_10.3/common/bin/commEnv.sh

it works fine.
13 years ago
Hi All,
I am trying to run a script using the source command through the following build.xml:

<project name="Sample" default="test">
<target name="test">
<exec executable="source">
<arg line="/opt/bea/wlserver_10.3/server/bin/setWLSEnv.sh"/>
</exec>
</target>
</project>


I get the following error on running this:
Buildfile: build.xml

test:

BUILD FAILED
/home/ser/minu/test/build.xml:3: Execute failed: java.io.IOException: Cannot run program "source": java.io.IOException: error=2, No such file or directory

Total time: 0 seconds



Could anyone tell me what could be the problem?

Thanks in advance!
13 years ago
Hi All,
Could anybody please tell me the exact difference between running a shell script with . and running it with source command?
For example, the difference between
. /opt/bea/wlserver_10.3/common/bin/commEnv.sh

and

source /opt/bea/wlserver_10.3/common/bin/commEnv.sh


Thanks in advance!
13 years ago
Hi,
I need some guidance to write an ejb container only for stateless session bean in order to use it with tomcat. If you could provide any links to internals of EJB3 container (something other than the spec) or reference implementaion of the container, it would be really helpful.

Thanks!
Hi all,
I need some help with writing a container for EJB3 that will enable me to deploy my EJB application on Tomcat.
The one I am using right now is designed for EJB2.
Any useful links/suggestions to start on this will be greatly appreciated.

Thanks in advance!
While I was preparing, I found the JavaBeat questions and the preparation kit offered by Enthuware very helpful. These exams cover almost every objective in the syllabus. Also use Mikalai Zaikin's study guide for brushing up at a later stage of your prep.
Hope this helps!
Good Luck!
Hi all.....
I cleared SCBCD 5.0 on Saturday with 73%.
I would like to thank all a Java ranch for helping me with my doubts.
And thanks to JavaBeat, Enthuware, EJB3 in Action and Mikalai Zaikin.

14 years ago
The question below is from the following link:webpage


9) Given an excerpt from an entity:
10. @Entity
11. public class Koala {
12. int children;
13. @Id
14. private Integer id;
15. /* ... */
16. }

The following code was written to find the sum and average number of children across all Koala entities (assume the variable em is bound to a valid EntityManager instance):
20. String query = "SELECT SUM(k.children), AVG(k.children) from Koala k";
21. Query q = em.createQuery(query);
22. Object[] res = (Object []) q.getSingleResult();

Which two statements are correct? (Choose two.)
a) There is a syntax error in the JPQL on line 20.
b) If the variable o is NOT null, the types of the two values in the array are Integer and Double respectively. (*)
c) There is an error in the typecasting on line 22, which results in a runtime or compile-time exception.
d) If the variable o is NOT null, the types of the two values in the array are Double and Double respectively.
e) The syntax of the JPQL statement on line 20 is valid and the code executes without an error. (*)
f) A runtime exception is generated on line 22.

REFERENCE:
Option E and Option B are correct. This is a valid JPQL query. (See 4.8.4 of the JPA Specification.) The Type of the return value is (Object[]) (see 3.6.1 of the JPA Specification) and in this case, the MAX aggregate function returns Integer and AVG a Double (See 4.8.4 of the JPA Specification.)
Option A, C, D and F are incorrect because there is no syntax error in the query or the code.




How can option e and b be correct???
Isn't SUM supposed to return Long when applied to state-fields of integral types???
Also, in line 22, how can getSingleResult() return an array of Object??? So option e also should be incorrect.
Please help............
Thanks in advance!
Following is a question from Sun's site: webpage



7) Which statement is correct about the EntityManager API?
a) The merge, persist, remove, and getReference methods must be invoked within a transaction context.
b) It is safe (no exception is thrown) to call merge or getTransaction on a JTA EntityManager instance.
c) The getReference method can throw an EntityNotFoundException. (*)
d) Runtime exceptions thrown by the refresh and createQuery methods of the EntityManager interface do NOT cause the transaction to be rolled back.

REFERENCE:
Option A is incorrect. getReference does NOT need to be invoked within a transaction context. (See JPA Specification 3.1.1.)
Option B is incorrect. An exception is thrown if you call getTransaction on a JTA transaction manager. (See the JPA Specification 3.1.1 interface listing.)
Option C is correct. Even though in general this behaves as a lazy proxy to an entity, an EntityNotFoundException can be thrown. (See the JPA Specification 3.1.1 interface documentation.)
Option D is incorrect. It causes the exception to roll back. (See JPA Specification 3.1.1.)



Here is my doubt:
I checked the JPA specification 3.1.1 and it says this about getReference method:


public <T> T getReference(Class<T> entityClass, Object primaryKey);
/**
* Synchronize the persistence context to the
* underlying database.
* @throws TransactionRequiredException if there is
* no transaction
* @throws PersistenceException if the flush fails
*/



So, shouldn't option a be correct???
Please help..............
Thanks