anil bisht

Ranch Hand
+ Follow
since Nov 04, 2000
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 anil bisht

Hi,
I am using Export to excel in my servlets. where in the user will be shown some details in the Excel format. I get data from the database and append it with "\n" for an new line and "\t" for a new column.
then i simply use the following to display the results in the excel sheet on hte browser.
objHttpServletResponse.setContentType(STR_MIME_EXCEL);
OutputStream output = objHttpServletResponse.getOutputStream();
output.write((byte[]) pstrFormatedData .getBytes());
Where pstrFormatedData is the data from the database after adding with "\n" and "\t"
It works fine, but if there is some data in the database which alrady have "\n" or "\t", then i have problem. As this data should be displayd in a single column, but this data is displayd in multiple columns. Is there any way out.
Regards
Anil
15 years ago
i am throwing a user defined exception from the DAO. it is being caught in the calling bean.
after catching the specific exception in the bean i catch the general exception.
by the time the exception reaches the bean it gets converted to general exception. as a result it is caught in the general exception catch and not in the specific exception catch.
Hi
If i synchronize a code will it work in the cluster servers.
I have two cluster server. Here i have the generating a unique file name. I check in a directory, and if the file name is present i generate a unique fine name by appending the time stamp. So this code has to be synchronized.
Now my both the servers are mapped to a sinple directory. Will my synchronized code run??. as now both the server executes its own code independendtly, will the synchronized code be synchronized or both the servers will run it own code.

TIA
Anil
16 years ago
it wont be possible as my file contains some french characters also...
16 years ago
Hi,
I need to check if a file is a binnary or ASCII. Only if te file is ASCII i need to process it. Is there any API by which i can check the file type??
I also need to list the file by modification dates. Is there any way i can get the list ordered by the modification date. by default ordering is on the file name
TIA
Anil
16 years ago
hi,
I got the solution for this.
Anil
16 years ago
hi
I want to read only the unread messages from teh mailbox.
I am using POP so flags are not working. I tried using the header getHeader("status"). but i am getting this as null.
Is there any way i can do this. I have to read the mailbox using java mails and process the mails. So in this case i should not process the read mails.

TIA
Anil
16 years ago
HI,
How do I save an email attachment after getting from the mailbox using java mail. This attachment is in binary form.
Regards
Anil
16 years ago

Originally posted by Peter W Smith:
use a MDB (Message Driven bean) and have the servlet sending request to it, then retrieve the reply from another messge queue with a timeout setting. If the servlet times out, display the message back to the user


I cant use message driven bean as the EJB is written by some othere vendor. And for getting the home and remote interfaces also they have given us the clases, so we just create an object of that class and that class in turn does all the remote calls. So we know nothing about that EJB. For us its just like a normal class.
Regards
Anil
16 years ago
fine i got the response from the ejb server. But then that ejb is making some Database calls and handleing some of the business logic. So if all this processing is taking time, how can i display the message to the user that "The EJB is taking time"
16 years ago
hi,
My servlet is calling an EJB which is in the other server. If that EJB call is taking time (lets say greater than 10 sec) then can i display the message to the user, and discontinue with the call to the EJB ???
Is using threads a solution.. how ??
TIA
Anil
16 years ago
I too think the same.
As we already have the home interface and bean is not going to do the lookup again.
So even if the jndi-binding is removed it should work.
regards
Anil
hi..
1) yes you can certainly do this. In fact its recommended as JNDI lookup is costly.
for more information
http://www.precisejava.com/javaperf/j2ee/Patterns.htm#Patterns102
2) i too am not sure for this. May be someone here could help us ???
Regards
Anil
Hi
i am using sybase server as my database.
From my EJB i am starting the transaction.(bean managed transaction). and my beans calls the Stored procedures.
But the problem i am getting is it says to set the chained mode off. How can i do it. There is a command in sybase
sp_procxmode <sp name>, "anymode"
but i dont want my sp to be run in anymode. Is there any other way around to solve this problem ??
Regards
Anil
This line gives me error..
UserTransaction utx = (UserTransaction)context.lookup("javax.transaction.UserTransaction
how do i bind the name ??

Regrds
Anil
17 years ago