Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

ilias basha

Ranch Hand
+ Follow
since Nov 27, 2008
ilias likes ...
Eclipse IDE Java Windows
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ilias basha

Chris Hurst wrote:the first gives you a way of synchronizing across all instances of a class the second gives you a way of synchronizing on one particular instance.



The above line left me with more confusion, than what i had earlier

How is it possible to all instances can be at synchronized block, though your second point is pretty understandable.
I have noticed sometimes in code having
and also in conventional style
Is there any difference between these two lines[assuming 'this' object refers the current object of SomeClass in my example].
Stephan, Thanks for the suggestion But my application runs on the windows environment, and using i am able to hide and make read only file in windows but was not sure of the windows32 api instructions to make changes in privileges of the file for restricting access though.

Joe, Thanks for the property to get the user name of the OS, but my requirement is beyond application, infact it should enforce restriction in OS level
11 years ago
Can we enforce user based read privileges in java?? or is it the responsibility of the OS-file system??
11 years ago
Hi,

I need to enforce user management with respect to the file reading in java applicaiton.

If the applicaiton is running under the other usernames it should not be allowed to read the file.

Kindly advise how to achieve this..
11 years ago
Hi,

I have a servlet code where an instance variable of Sevlet will be incremented each time the Servlet's service/doGet/doPost is invoked. By this way i am able to know how many times the partcular Servlet is requested..

here is code for the same.


My Question is now how to write a jsp which is exactly equivalent to the above given Servlet - specifically with respect to having an instance variable??
11 years ago
JSP
If i am using TOMCAT as container and configured all JNDI configuration with required properties, once TOMCAT is started, the connection pool should be ready and when we lookup for the DataSource instance we will get hold of the connection pool.

Am I correct here?

If i am correct above, even if i try to lookup multiple times, i will get the hold of same connection pool, which is created at the startup of TOMCAT??

Thanks for being patient enough to explain!
So does that means - if i create an instance to the DataSource i am actually creating a new connection pool?
But, i have seen one code, where in singleton patten has been applied to get the DataSource instance - this made me to think whether this is a costlier resource as how Connection object?

Otherwise, what could be the reason behind this?
Is javax.sql.DataSource a costlier resource like java.sql.Connection?

I am asking this question, as i have seen one of the code having a SingleTon implementation to get the DataSource object.
thanks for both of you
12 years ago
sorry, I mean xyz in the following statement
new String("xyz")
12 years ago
As the Strings are stored in String constant pool, i have the following question

* if we use new String("xyz"); - will this xyz still be part of String Constant Pool or just part of HEAP as any other object does?
12 years ago