Tmmet Johnson

Ranch Hand
+ Follow
since Nov 03, 2004
Merit badge: grant badges
For More
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tmmet Johnson

Hi,
Could you please post the code snippet for connecting remotely to Lotus Notes Repository and reading / downloading all the documents in it ?
Thanks in advance,
14 years ago
Hi,
I want to connect to Lotus Notes repository programmatically from java and search for documents by 'project name'.
Could anyone please let me know the Lotus Notes JDBC driver which can perform the above ?
Any help is greatly appreciated as I am totally new to this area.

Thanks in advance,
Hi,
I am trying to run the StaticRefPolicyFinderModule class that comes with SUN XACMl 1.x implementation source code.
I aminstantiating the class as below.However, this does not work.I am getting an exception. Could anyone please let me know how to instantiate and use the StaticrefPolicyFinderModule class. Thanks in advance,
List<String> pList = new ArrayList ();
pList.add("C://policyfile.xml");
StaticRefPolicyFinderModule ppsFinder = new StaticRefPolicyFinderModule(pList);
14 years ago
Hi,
I am new to EJB.Can anyone say me whether I can return ArrayList from my bean method ?
That is, all my input and output parameters of my bean method must always be serializable objects ?

Thanks in advance,
Hi ,
I am using datasource to get the jdbc oracle connection.
I have a singleton class which has datasource as member variable and has two methods - getInstance () and getConnection().
This singleton class's getConnection() will be called in all DAOs.

Will I run into any performance or deadlock issues in the above

Please let me know.
Thanks in advance,
Hi,
I am new to EJBs.I have stateless session beans.Can anyone say me whether it is ok to have return value as int in an ejb method ?
Also, can I call a singleton class's method from a bean method ?

Thanks in advance,
Hi,
Can anyone help me out ?
I am using Stateless session bean. In my bean, I call BO class which performs business validations and then , call Data Access Object class
(say, class A) .The class , A updates Db2 database table A, then, calls Data Access Object class B which updates database table B and class A then calls Data Access Object C which updates tables C.All the above are performed in the same DAO class A's method.

TheEJB method transaction attribute has been set to Required.

My question is can I pass the same connection from class A to class B and C. Or,is it good to use separate connections (fetched from the connection pool) in class A,B and C ?
I know both ways will work. Can someone say me which will be faster and better than the other.
Thanks in advance.
Hi ,
What will happen if I have a derived class default constructor which does not call the base class constructor as below?
Will this cause any issues?
Thanks,

public class Base{
private String st = null;
public Base (){}
public Base(String str){
st = str;
}}

public class Derived extends Base{
public Derived(){}

}
}
17 years ago
Hi,
I throw an application exception as below in my catch blocks.
Does this catch block will miss the stacktrace exception when finally caught in the caller method?
Could anyone please let me know?Thanks in advance,

[ Edited to include code tags - Paul Sturrock ]
[ November 01, 2006: Message edited by: Paul Sturrock ]
17 years ago
Hi,
I have a stateless session bean.I call my Data Access Object (DAO) class from my ejb method.
Can I catch Throwable in my DAO method ?
In the Throwable block, I am planning to throw an application exception.
Is there any drawback in this approach.Since, catching Throwable catches error and all runtime exceptions, there will not be any work for the EJB Container when a runtime exception occured.Is this the good way?
Please let me know.
h
Hi,
I have a question.
How can I call a webservice from my swing application?
I got the wsdl file from the vendor and have created the proxy out of it.But,not sure how to call the webservice from my swing application.
Could anyone mail me the steps ?
Thanks in advance,
17 years ago
Thanks!!
Could you please post what is the disadvantage or loophole on having a class with all static methods?
Thanks in advance,
17 years ago
Hi,
Can I have all methods related to session in one Utility class as below?Is there any disadvantage or issue on using the below approach?If so, what are the cons?
Thanks in advance,
public class SessionUtil {
private SessionUtil{}
public static HttpSession createNewSession(HttpServletRequest request) {
//create a new session, if one does not exists
HttpSession session = request.getSession();
putSessionValue(request, CONSTANTS.KEY, CONATNVALUE);
return session;
}

public static HttpSession getSession(HttpServletRequest request) {
return request.getSession(false);
}
public static void putSessionValue(HttpServletRequest request, String key, Object value) {
HttpSession session = request.getSession(false);
session.setAttribute(key, value);
}
public static Object getSessionValue(HttpServletRequest request, String key) {
HttpSession session = request.getSession(false);
return session.getAttribute(key);
}
public static void cleanSession(HttpServletRequest request) {
HttpSession session = request.getSession(false);
session.invalidate();
}
}
17 years ago
Thanks for the replies.
One clarification though.I understand that I will have one instance per JVM.
I have deployed this application only in one JVM.No clustering or load balancing on my Websphere server.

In my code, since, the class will loaded during application launch (as it is a static block), so, I will have only one instance right?Just want to make sure the approach that I used is same as
public static Util util = new Util();
Thanks in advance,
17 years ago
Thanks!!
So, even if I make the Util() constructor private, I might have one instance per JVM.And, this would be the same if I had the below.
Please let me know whether I am correct or not.

Thanks in advance,


public class Util{
private Util(){}
private static Util util = new Util();
public static Util getInstance(){ return util;}
}
17 years ago