marlajee Borstone

Ranch Hand
+ Follow
since Jun 26, 2008
Merit badge: grant badges
For More
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 marlajee Borstone

Hi Paul,
It worked perfectly. Thanks a million sir.
I am attaching the complete code here which I have executed for reference :

12 years ago
I am trying to send mail from my Java program.
I have disabled the firewall for this even though I get the Authentication failed error.
Can some one please look into the code and suggest what is the thing missing here or doing what mistake in this code...

any pointer to the solution if anyone have already used this code, would be highly apprecitated.

12 years ago
But I am not sure why we need at all to override the equals() and hascode() methods in any class; because if we look into this example:-
Say we have a class which has a String variable as isbn which needs to be set by passing through constructor.

This code segment will display objects are equal even though firstBook and secondBook reference two distinct objects. They are considered equal because the objects compared contain the same value.

By overriding the equals() and hascode() method we do nothing new rather than generating a hashcode which uses all the variables values used in that object. So that if that object is compared with any other object, the hashcode() will be check and if it is found as same then they are decided to be equal.

So, why do we need to bother to override this equals() and hascode(), why just follow the process as shown above for firstBook and secondBook ?

Please help to get the clear reasoning regarding this above example in context with overriding equals() and hascode().

I will appreciate your input...

Dhannsumal !!
12 years ago
I am working on a web application project using Spring and hibernate framework.

I have kept all the documents at their proper location, as I beleive. Like:-
I use spring-hibernate.xml file which is placed inside WEB-INF folder and a copy I have kept into 'Build/classes/com/fmt/' folder as well so that during run time the application can find it in CLASSPATH.
Also, in web.xml file:

But when I click on submit button on home page, I get this ERROR:-

I am sure the location of spring-hibernate.xml is not proper here - and I missing to find the exact location where it needs to be placed so that java code

can find it.

13 years ago
can some one please help me to write the java code which wil sending the mail - simple and with attachment both ?

thanks in advance...

13 years ago
I have a class (say class 'A' ) which has two methods [ m1() and m2() ] both are synchronised.
Is it possible to call m1() and m2() of the same object of class 'A', by two separate threadts 't1' and 't2' concurrently:


What will happen if m1() is synchronised and m() unsynchronised ? will again it will be possible to call t1.m1() and t2.m2() simulteneously ?

appreciate the reply

My application is using java and Hibernate technologies. I have a separate class to open the session factory to work with database.

All my DAO acesses databases using :

My question is, how this code will solve the problem when there are 5000 users accessging different part of my web
application to view different set of data. (though i have declared 30 connection poolsize in hibernate.cfg.xml file)

HOw does hiberntae handbles this call? Will there be a request in waiting mode
mean while the fist request finished its job at sessionfactory ? I doubt if my desing approach is correct .

Need some input to clear mydoubts please.
Hi thanks for response.
But unfortunately I don't have any idea if JSON.
Will it be recomendable to use Castor tool which will marshal and unmarshall the XML document ? Will it reduce my burden of creating XML document for Ajax response and further retrieving from xml elements ?

please suggest.
Hi friends,
I am using Ajax in my web project. The requirement is to return lots of data from mulitple tables in database, to UI (jsp) page. I have multiple Java classeses with getter and setter methods to hold those data. Is there any way that I can pass these entire Java object itself to JSP page using AJAX. So, that on JSP page I can retrieve the values from using getter method of those objects . Storing those bulk data in xml element of XML response document and retriving back them on JSP and then adjustung for proper display is very painful .

Can someone please suggest somw easiest way to get Java object on UI page using AJAX ?

thanks in advance,
HI Cameron, thanks for directing me to one specific approach.
However, since the name of Tables and their structure are same in both the databases (SQL & Oracle), does a Single POJO class will meet the pupose of two different databases here ?
Will it not affect the caching and performation of application ?

I am developing a project using Hibernate and the requirement is to connect to two different Databases
1. ORacle and
2. SQL Server.
The same set of tables exist in both the tables.(i.e. name of Tables and their fields are same in both the databases).
Both the databases need to be accessed during the life cycle of request from user.
How I can I achieve this using Hibernate ?
I have read few blogs on web, some speaks:
- by making two different hibernate.cfg.xml file and having two SessionFactory Instances.
- Somewhere I can see as Using JTA.
- Some says using ThreadLocal .

But I don't get any stepwise example of codes for any of above approaches.
Can someone plesae help me to point to such step by step solution from where I can get this solved with better understanding of these approaches.

The more descriptive will be more appreciated as I am not expert in Hibernate

I have a small doubt on static synchronise.
Say I have a class 'A' that has three methods:

These three methods of class 'A' are tried to be accessed by four different threads t1, t2, t3 and t4 from some third class 'B'; like:
Can threads t1 and t2 access the single static method meth1();while t3
trying to acess meth2() and t4 an instance method, meth3(). Can all these four threads execute concurrently as per the statement written in above class 'B'?
[ October 14, 2008: Message edited by: marlajee Borstone ]
As per servlet 2.4, the SingleThreadModel is now deprecated. THen, how to make a Servlet thread-safe.

15 years ago
If we make an object of any class, say 'Anyclass', in such a way:

What would be the significance of declaring an object as final ?
15 years ago
Thank you Henry for this clarification as well as for previous reply.
it is really very helpful.