pendse anagha

Ranch Hand
+ Follow
since Mar 09, 2005
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by pendse anagha

Bingo !!!
Yes - I was somehow expecting that on subsequent references to the variable - since it has a method call on RHS - I was expecting it to invoke that method everytime !!!

It now makes sense - it is just a variable - and once it has a value assigned to it
- its value wouldnt change unless explicitly changed

Would you call this bad coding practice ?

I was definitely confused.

Here is a bit more elaborate code
However thanks Ernest - my doubts are indeed clarified with what you rightly point out.

Thank you once more.

Class that looks for changed values in the database and which populates the HashMap
This class runs every 10 minutes and refreshes the HashMap

12 years ago
Thanks Ernest for your prompt help.

Could you kindly elaborate or point me as to where I could look up and get a better understanding as to why the static method never gets invoked again ?

Apologies if this seems to be too basic a question.

Regards ,
12 years ago
Hello ,
I am facing a problem for which I dont seem to have an answer to .

I have a class in which I have defined a static variable ( not final )
The value of this variable comes from a method
Here is the code :

The HashMap that I am using contains key value pairs which come from the database

The first time I run this code it runs fine
I get the value correctly in any other class when I refer this static variable - "test"

However if some value changes in the database - then that key and value get replaced in the hashmap

The problem is even though the values have changed in the hashmap
(I have printed the hashmap contents which shows the changed values )

if I use the variable - "test" it still gives me the old values

I tried putting in a System.out.println in the method - "getTestValue"
The first time it prints fine
On subsequent reference to the static variable - the right hand side i.e the method just does not get called

No wonder I do not see the changed value.

But why does the method not get executed ?

Please help

Regards ,
12 years ago
Thanks Ulf for your suggestion .

Please bear with me since some of the questions may sound vague and inappropriate.
My lack of basics related to JCE and the need to do an implementation of JCE
is driving me nuts .

OK : here goes with a few more of my doubts :

I am using JDK1.3
I tried using the "DES" algorithm

I could get it running by adding "jce1_2_2.jar" & "sunjce_provider.jar" in my classpath
Here is a link which provided me with information about setting up JCE for 1.2.x flavour of JDK :

To get it running -
1 >option 1 - add the following line :

2 >The other option is - add this line in my Java code :

Here are my observations :
If I dont do either of the above configuration ( for SunJCE Provider ) then I get a run time exception Algorithm DES not available

So my questions / doubts / inferences are :

1 >DES is not supported by the other providers : com.sun.rsajca.Provider

2 >So what kind of algorithms are supported by either com.sun.rsajca.Provider ?

3 >I am and will be using JDK1.3
So are there any examples of algorithms that are supported by the providers mentioned above ?

4 >If I wanted to use SunJCE provider - is it better to add the provider through code or in the file ?
What are the advantages or disadvantages in the above method ?

4 >Could someone point me to some examples which use the above providers ?

5 >I tried looking into JDK1.3 - I am not able to locate the classes with the correct Package structure ?
So I am not sure if these are classes that need to be implemented by some third party ?

Totally confused.

Any help is greatly appreciated .

Regards ,
12 years ago
Hello ,
I need help regarding encryption and decryption .

I need to do the following :
1 >
User will ente some text

2 >
Encrypt this text and store in database

3 >
while retrieving data - decrypt and display to user

My environment is JDK1.3 and I am using Dynamo

Could someone guide me with some examples as to how I could encrypt simple string data and store in database and conversely decrypt and display data .

My limited knowledge tells me that MD5 can be only used for encryption - not decryption

I also tried some examples from googling related to - "DES"
However when I try to run the examples - I get this error -
"java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set up certs for trusted CAs: java.lang.SecurityException: Cannot locate policy and/or framework files for signer restraint check!
at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
at javax.crypto.KeyGenerator.getInstance(DashoA6275)"

I am sure I am missing something very very basic .

Any help would be greatly appreciated.

Thanks in advance,
12 years ago
Hello ,
I am trying to build a common library ( JAR file ) that would be used
in a number of applications .

I plan to use Log4j for logging in this common library

However - I am not sure if the same Logging can then be used in my applications that make use of this common library .

Or will I have to again incorporate Log4j in my other applications too ?

Regards ,
I am a bit confused about this file

what is the purpose of this file

From what I have read / googled - looks like
I can define my - java / ejb / war file

What is the purpose ?
Does this mean that an application will not run if I do not have this file ?

Could someone please give some guidance ?

Regards ,
12 years ago
Hello ,
I am designing a system which is supposed to be shared across multiple applications .

While authenticating - I am supposed to check :

1 >Is the user present in the database
2 >Is the user active ( "status" field in database )
3 >Is the application active ( "status" field in database )

So one approach I was thinking was -
I would always get a Value Object ( DTO )
This object would have attributes such as -
"isAppPresent" , "isAppActive" , "isUserPresent" , "isUserActive" etc

Based on these attribute values - I would display the appropriate message on the UI

The other option is - write three exception classes - "ApplicationInactive" , "UserInactive" etc

Was wondering - should I throw exceptions and based on my exception logic deal with the situation or look at my Value Object attributes and take a decision ?

Thanks in advance ,
Thanks Ritesh and Paul ,
I will check out your suggestions .

Regards ,
12 years ago
Hello ,
I am trying to write business logic based on PST and PDT
The code runs on a server - whose timezone is changed appropriately as required between : PST & PDT
( As of today it has been changed to PST )

I am trying to figure out when its PST and when its PDT through code.

I am using this code :

However - this code always specifies that the Timezone is PDT
i.e above method returns TRUE even though I can see that the server is specifying PST

So I am now using this :

This code works fine .

What is wrong with the code which uses the Timezone class ?

Thanks in advance ,
12 years ago
Hello ,
First up - apologies if this is not the formum for this question

Since I am developing a web application - I thought this would be the best place to post the question :

We want to communicate with LDAP and get some user details
We can get user details based on either : EmployeeId or EMail

So I have two methods written .

However the code that communicates with LDAP is only exposed through
a Jar file
We are supposed to instantiate a Class - "LDAPManager"

Here is my question -
Is it ok if I declare a class level "LDAPManager" variable
and reuse the same in both methods ?

or would it be better to define local variables in each of the two mwthods ?

Could someone shed some light on the advantages and disadvantages ?

Thanks in advance ,

Here is my code :
12 years ago
Hello ,
I am using the errors tag to iterate over the errors - which I need to display
on UI

I am using the following code :

The output that I get is something like this :

I do not want the <ul> tags - since the UI is getting messed up

Can anyone please suggest a solution ?

Thanks in advance ,
12 years ago
Hello ,
Could someone kindly guide me with the following questions I had in mind :

1 >
Is struts a framework that implements MVC ?

My undersatnding is that it is - but would just like to know others views and links to articles where I could further look up this info .

2 >
What are the different important design patterns that are implemented
in typical usage of struts ?

Thanks in advance ,
12 years ago
Hello ,
I have a search screen - where user enters a number of parameters and based on these inputs - system searches the database tables and gets the results

System then generates a csv file and this is returned to the user

The entrie activity is synchronous .

The problem is - in the tables there are practically millions of records
so application just sits till results are returned

This could take loads of time - which is not desirable

Can someone suggest a asynchronous approach

I was thinking of this approach - where asynchronously some kind of scheduler processes the data and then sends across a link via email

However - the problem is - the user will then have to again authenticate

I do not want the user to again authenticate

( I am not using cokkies for authentication - using HttpSession )

Your suggestions are most welcome

Thanks in advance.
12 years ago
Hello ,
Today - we tried to migrate our application from a 32 bit Oracle 8i environment
to a 64bit Oracle 9i environment .

Whiel going through the application - we encountered a strange problem
where we invoke a stored procedure - and the stored procedure is supposed to return us a cursor handle which we use to loop through data in java .

What is observed is that on executing the stored procedure through java ( old jdbc driver that was supporting 8i ) the results were kind of screwed up

Executing the stored procedure stand alone from a prompt works fine .
The same code and driver when pointing to 8i 32 bit environment
gave us correct results

I am not good at this - but wanted to know - would the driver play a part ?
Would the driver need to be able to support the 64 bit environment ?
Is there a limitation to the way SQL is built in 91 as compared to 8i which could be causing this problem ?

( we are using a driver which is in a jar file - classes12.jar )

Thanks in advance ,