Kannan Venkateshan

Greenhorn
+ Follow
since Nov 19, 2003
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 Kannan Venkateshan

Hi,

I did not get an oppertunity to check your code, however, answering your query in general, i feel that using the flush() method of Java I/O should solve your problem of writting the contents to the text file. Normally what ever we intend to write to the file is stored in a buffer and until we use the flush() method we will not be able to (flush) write any buffered chars to the underlying stream.

check your code if you are flushing the contents properly to be written.

Thanks and regards,

Kannan
14 years ago
Hi All,

This indeed was a very simple question and i am surprised that i was unable to figure it out myself.

This is what happens i guess :

1) in the first instance when i am removing/commenting the "if" condition, the variable in which i am storing the value is not being checked or used explicitely - so we have the system checking in for the exception and throws one exiting the program.

2) when we give an explicit "if" condition, the variable is used to check a condition and becasue the contents are "null" - an explicit exception is thrown. And this is caught in the try-catch block.

Thanks and regards,

Kannan
14 years ago
Hi,

I am facing this strange NULL POINTER EXCEPTION phenomenon.

In my programme, i have a String Variable which is populated by a method from a different java class in the same package. In order to counter a Null Pointer exception (incase the method that is being called for returns a null), i am using try catch block. Now my query is, the try catch block works perfectly if i use a IF condition as is shown below, else the try catch block is never reached. The code is :

try{

String abc = Diffclass.getString();
if(abc.equalsIgnorecase("null"))
{
SOP(" something "); //this however does not get printed even if the try catch works
}
}
catch(NullPointerException ex)
{
SOP;
Continue;
}

if i remove/comment the IF condition the try-catch block is not executed.

am i missing something important here and so i find this strange ? or what is actually happening.
14 years ago
Hi Karthikeyan,

why do you need a %emp% in your String statement ???

just use

String sql_getAll = "select * from DEPARTMENT WHERE EMPNAME LIKE '" +emp+ "';";

and i guess things should work fine.

cheers,

Kannan
Hi Guys,

Hope this link helps you out in your quest for a good JSP BOOK.

http://www.javaworld.com/javaworld/jw-09-2000/jw-0929-jspbooks.html

cheers,

Kannan
14 years ago
JSP
Hi Mr.Friedman,
thank you very much for your inputs on this query of mine. infact i was posted this question in an interview and i was unable to give a genuine explanation, so i had to post this question in this discussion group.
thank you once again
kannan
hi frnds,
my name is kannan and i have a doubt which is bugging me for a long time - hope i get an ans here in this discussion group. i have read umpteen number of times that a thread should be run only through the start() method but no one has come out clearly as to y ?? my question is y should a thread be run only using the start method, cant we call the run method directly ??
whats so special about this start method and why is run() dependent upon start ??
thanking you in advance
kannan