saravanan kanda swamy

Ranch Hand
+ Follow
since Apr 21, 2004
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 saravanan kanda swamy

Thanks for the reply.

However I have another doubt, Will it be okay if I use entrySet instead of iterator?

"And also using 2 ConcurrentHashMap will be thread safe as the logic is in such a away that if the validation is successful then it will be removed from the unlocked and same will be put in locked. "

Do we need to place them in synchronized block, as ConcurrentHashMap will be thread safe to itself not to each other.

Thanks and Regards,
Saravanan.K
Thanks for reply.

I have made the changes, however I read that using iterator in ConcurrentHashMap is not advisable.

So I did the looping thorough with the entrySet.

I have attached the source code as well.



Will it be okay if I use entrySet instead of iterator?

More over I have doubt that using 2 ConcurrentHashMap will be thread safe as the logic is in such a away that if the validation is successful then it will be removed from the unlocked and same will be put in locked



Kindly clarify.

Thanks and Regards,
Saravanan K
Hi,

I read in Thinking in Patters it mentioned that Singleton pattern is used in Object Pool.

I also saw the samples code in it. I couldn't figure the usage of singleton in object pool, the way i understood is that in Singleton pattern only one object will be created. This we do using private constructor. However I couldn't find private constructor in Object pool.

My doubt is if there is no private constructor then Object Pool is not based on Singleton pattern.

Another Reference in web link: http://sourcemaking.com/design_patterns/object_pool/java

Can somebody explain me why they say that Singleton is based on Object Pool.

Thanks in advance,
Saravanan.K
Hi,

I am calling a procedure in a package using weblogic driver class. In that procedure I am closing all the other connections of oracle. After that I am executing this procedure.

weblogic.jdbc.common.OracleCallableStatement - class

OracleCallableStatement calstmtObject
(OracleCallableStatement)getConnection().prepareCall(strProcQuery);

and then I am doing this:

calstmtObject.registerOutParameter(1, Types.VARCHAR);
calstmtObject.registerOutParameter(2, Types.VARCHAR);
calstmtObject.registerOutParameter(3, Types.CLOB);
calstmtObject.registerOutParameter(4, Types.DATE);

all are out parameters in reading the clob data i am getting this error.

Clob clobData = calstmtObject.getClob(3);

and then I am passing that clob object to the separate function which will read and give the values in string.

But sometimes while reading this value in the function where I am getting the String value

I am getting this error.

java.io.IOException: Error in getLobStringValue java.sql.SQLException: ORA-14453:

at weblogic.db.oci.OciClobCharStream.read(OciLobReader.java:265)
at weblogic.db.oci.OciLobReader.read(OciLobReader.java:161)
at java.io.BufferedReader.fill(BufferedReader.java:134)
at java.io.BufferedReader.readLine(BufferedReader.java:294)
at java.io.BufferedReader.readLine(BufferedReader.java:357)

only some times I am getting this error.

But I am not able to find out the reason.

Thanks in advance

Regards,
Saravanan.K
Hi,

I am trying to read the CLOB data using the BufferReader. But sometimes it gives an error saying unable to read the CLOB data.


The Code I have used as follows:

StringBuffer strData = new StringBuffer();
Reader reader = clobData.getCharacterStream();
BufferedReader bReader = new BufferedReader(reader);

String strLine = new String();
while ( (strLine = bReader.readLine()) != null)
{
strData.append(strLine + "\n");
}
return strData.toString();

I am getting an error while reading the CLOB data.

java.io.Exception:java.sql.SQLException: ORA-14453

I am using weblogic 6.1 and using weblogic oracle drivers. The oracle version is 9i.

I am not able to find the cause of the problem. Please guide me how to resolve this error.

Thanks in advance

Regards,
Saravanan.K
how to create .ks file generation from the keystore and how to import a PFX file in to that keystore file.
14 years ago
Hi,

I need a tool which will verify the code allignment with existing code in VSS when ever we checkin any new code. It also needs to send email regarding checkin or checkout happens in VSS. Is there any Open source tool which is availble to do this task?

Thanks in advance.

Regards,
Saravanan.K
Hi,

No encoding is not at all a problem. But when get that value from the string

String strReq = Request.getParameter("DATA");

I am doing this to find that value

byte b[]= strReq.getBytes()

System.out.println("The size is "+b.length);

It is giving the same length as the length of string .

Even though character in java are 2 bytes. How will you separate the japaense double byte and single byte from a string.

Thanks and Regards,
Saravanan.K
14 years ago
Hi,

I have a scenario like this. The user will send the japaense data in the request parameter. He is sending the double byte characters and single byte chracters. Is there any method to find out the if it is a double byte or single byte character. from the HttpServletRequest object.

Because what is happening is once we got the data using the request.getParameter we are getting a string there all the characters are shown as single bytes only. But I need to separate single byte characters and double byte chracters.

Thanks in advance

Saravanan.K
14 years ago
Hi,


I need to add because my requirement is like that acutally the application is depolyed like this.

Another Appliation --> My Application

The Another Application will send a request to my application in that i need to add the parameter in the HTTP Header

Thanks and Regards,
Saravanan.K
14 years ago
Hi,

I have a problem like this. How to add a parameter in HTTP Header which goes along with the request.

There are no methods available to set the Header values in the HttpServletRequest object. We can set only the Header values in the HttpServletResponse Object.

Please help me how to solve this.

Thanks in advance

Saravanan.K
14 years ago
Hi,

I have a problem in reading the japanese chracters from the form element. Acutally from one parameter I am reading the values like this

String strDetails = Request.getParameter("Details");
If that form field has only japanese character then everything is coming fine. But the requirements is it will have many details like Slno, Name,Address etc. I am getting that in the string and using the offset only i am identifying the parameters. Say slno will be from 1 to 2 and name will be in 3 to 20 and Address will be in 30 to 60.


I am separating the parameter like this.

String strNo = strDetails.subString(0,2);
String strUserName = strDetails.subString(2,20);
String strAddress = strDetails.subString(20,30);

The problem is like when i use the offset to get the values from the string the offset is getting changed if the request is coming from another (japanese)server. But when they print the request that have sent it is coming fine which means the offset is correct at their end including the japanese characters. But when it reaches the servlet then the offset is getting changed.

In detail if they send some 10 japanese characters it is coming here as 5 but the characters are same. I think this is problem due to double byte. They are sending Kanji characters. Instead of getting japanese characters i am also getting the some charaters from the address field also.

like if they send request like

http://ip:7001/request.do?Details=01XXXXYYYYYYY

where XXXX is japanese characters (kanji)

while it reaches my server i am getting the request like this

Details=01XXYYYYYYY

So when I try to get the values using the offset i am not able to get the values properly because of the offset. But when i try to print the values in the page it is coming fine.

Please help me how to resolve it.

Thanks in advance

Saravanan.K
14 years ago
Hi,

I have a problem like this. My Application is depolyed in this fashion.

Browser -- ServerApplication -- My Application

Now the requirement is like this. Server Application will access to My application and once the User logged in to My application. If the user submits the data the request will come to My Application. But the server application identifes that request and appends some more parameters in that.

My Applicaion is J2EE deployed in Weblogic 6.1, The request is HTTP Request

Please let me know if this possible.

If yes how to simulate that.

Thanks and Regards,
Saravanan.K
14 years ago
Hi,

I have a problem like this. My Application is depolyed in this fashion.

Browser -- ServerApplication -- My Application

Now the requirement is like this. Server Application will access to My application and once the User logged in to My application. If the user submits the data the request will come to My Application. But the server application identifes that request and appends some more parameters in that.

My Applicaion is J2EE deployed in Weblogic 6.1, The request is HTTP Request

Please let me know if this possible.

If yes how to simulate that.

Thanks and Regards,
Saravanan.K