Vasco Dion�sio

Greenhorn
+ Follow
since Dec 04, 2003
Merit badge: grant badges
For More
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 Vasco Dion�sio

Hello,

Can anyone tell me how can I write a query using EJB QL for a finder method that uses an array as a parameter? For instance:

Finder Method
ejbFindByFormId(String[] forms)

I have tryed to use the following Query but without sucess (I get an error)

select object(f) from ZFormBean f where f.formId in ?1


Thanks
Vasco
Hello,
Could anyone tell me what are the main diferences between AWT and Swing.
Why should I use Swing and not the AWT?
Is Swing and improved "version" of AWT?
Sorry 'bout the basic questions...
Vasco
19 years ago
Thanks to you both... I think I got it... I am studying for the Sun's JAVA 2 programmer certification... first things first...
Best regards
Vasco
Hello,
Could you please tell me:
What exactly is WebSphere? Is it an IDE to develop J2EE Applications? Is it a broader software?
Does the book explains mainly how to use WebSphere to develop J2EE applications or does it also explains what are J2EE applications and related technologies (I have seen in the book's table of contents a chapter about Servlets and another one about JSPs... do you teach in the book what these tecnologies are?)?
A last question:
What is the diference, for instance, from beeing an IBM Certified Enterprise Developer or a Sun's J2EE Certified developer?
What are the "best" certifications for someone who want's to turn it's professional career to Java development?
Thanks a lot for your time
Vasco
[ February 03, 2004: Message edited by: Vasco Dion�sio ]
Hello again,
Thank you so much everybody... You have been very helpfull...
The solution using addShutdownHook seems to work fine when I stop the server with CTRL+C or with the kill command... I have to wait now to see how it works when a runtime error occurs...
I hope that one of these days I'm able to help you although it migth take a while since I am only a rookye...
Regards to all,
Vasco

[ January 30, 2004: Message edited by: Vasco Dion�sio ]
[ January 30, 2004: Message edited by: Vasco Dion�sio ]
20 years ago
It runs on an application server and it receives several (10) calls per minute... I do one write for each call... so we are talking about 10 writes per minute...
Best regards
Vasco
20 years ago
Hello Jason,
Now you got me completly confused...
Kathy Sierra writes in her book "Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)" - pag. 398 - about cleaning up memory before GC and the finalize() method and I quote:
"So, any code that you put into your class�s overridden finalize()method is not guaranteed to run. The finalize() method for any given object might run, but you can�t count on it, so don�t put any essential code into your finalize() method. In fact, we recommend that in general you don�t override finalize() at all."
So... I thougth we couln't rely on the execution of the finalize() method...
that's why I didn't used it at first and replaced the code with the finally block...
Thanks again for your time Jason
Vasco
20 years ago
That's OK Jason... thanks again for your answer...
I used to think that we have no garantee that the finalize() method is ever called... Isn't it related to cleaning up memory when the garbage collector executes... furthermore, what might happen, what are the implications off not closing the file output stream ever?
Thanks again
Vasco
20 years ago
Hello Jason,
Could you help me a little bit more, please?
Thank you
Vasco
20 years ago
First off all thanks for your answer Jason...
Another question...
I am using a "closed" source API by SAP, A.G.
The class where my code runs is a class that extends another class which in turn implements the Runnable interface.
myclass extends ServerClass (closed source by SAP, A.G) --> implements Runnable
Each time I want to append a line to the log file I open the file stream, write the line to be appended and close the file stream. I think that if I would not open and close the file stream each time I wanted to write to file would be more performant. I could open the file output stream in myclass's constructor, write the line each time I want and in the end close the file stream. My problem is "Where can I close the file stream?" because my application is a server which is constantly listening to network calls ---> it "never" ends unless I stop it.
I tried to override the run method of the original ServerClass like this...
public synchronized void run() {
try {
super.run();
}
finally{
System.out.println("I could close the file stream here");
}
}
But I nerver see the message "I could close the file stream here" displayed in my screen. Do you know why this does not work?
Thank you very much for your help...
wich you the best
Vasco
20 years ago
Hello guys,
I wonder if you could help me out... I need to write an application log file... I wrote the following method and each time I want to write some String to the file I call it but I'm not sure if the performance is the best I can get. What do you think? Do you know a better way to do it?
private void printLog(String s) {
RandomAccessFile f = null;
try {
f = new RandomAccessFile("mylog.txt","rw");
f.seek(f.length());
f.writeBytes(s+"\n");
} catch(FileNotFoundException e) {
System.out.println("File not found");
} catch(IOException e) {
System.out.println("Couldn't open file");
} finally {
try {
f.close();
} catch (IOException e) {}
}
}

Thank you all in advance
Bye
Vasco
20 years ago
Congratulations guys!!!
Make good use of it...
Vasco
20 years ago
Thank you both...
I will read those articles now...
20 years ago
Hello again,
Have I said something that doesn't make sense?
Thanks,
Vasco
20 years ago