Sergiu Truta

Ranch Hand
+ Follow
since Dec 16, 2003
Merit badge: grant badges
For More
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sergiu Truta

Thank you for your feedback Jeroen.
19 years ago
Hi guys,

hope I got the right forum. If not, I just have a quick question. Are there any restrictions about using Java comercially? I mean I want to sell java programs. Do I have to pay something to SUN for this?
Also, the same questions for both Tomcat and MySQL? How much do I have to pay in order to use these inside the products I'm selling?
The question became three questions ).
Thanks for your info ).
19 years ago
This is an example for FETCHING messages:
String host = ...;
String username = ...;
String password = ...;
// Create empty properties
Properties props = new Properties();
// Get session
Session session = Session.getDefaultInstance(props, null);
// Get the store
Store store = session.getStore("pop3");
store.connect(host, username, password);
// Get folder
Folder folder = store.getFolder("INBOX");;
// Get directory
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i<n; i++) {
System.out.println(i + ": " + message[i].getFrom()[0]
+ "\t" + message[i].getSubject());
// Close connection

For more info you might want to check this out.
20 years ago
I'm looking for an answer to this question my self...if you find something please share it with us.
20 years ago
Hi guys,
I'm pretty new to java mail API and I am working on a web email client. Now I'm at the step of moving messages from one folder to another. Please suggest the most used solution.
20 years ago
Hi guys,
I'm looking for an O/R mapping free solution. I know so far about Castor JDO and Hibernate. If you have any info on this subject and maybe some reasons why one should be used please share it with me.
Thanks a lot,
You usually use several session beans as a facade between the client code and the entity beans.
One session bean contains usecases(methods) which implement related work. So for each group of related usecases you implement a session bean.
You shouldn't use a master session bean, one which contains all the facade code, because this will quickly become very large, hard to understand and maintain.
For example if you implement an an on-line application for renting cars, you will have one session bean which contains the methods related to registering users, another session bean for all the operations which provide information about the available cars, another session bean for the operations needed for renting a car, and many other like these.
I hope you got the point
Having CMR and the container to handle relationships is a great ease for a developer. I think this is enough as a reason for using relationships in CMP .
Caching EJB objects doesn't help you very much. Usually you have to use several objects of the same type and instead of caching let's say 10 EmployeeBean bean objects,you cache only the EmployeeHome object and through this you can create/find/delete any number of EJBObjects.
The EJBHome object is used as a factory for EJBObjects and by caching it you don't have to look it up every time you want to manipulate an object it is responsable of.
You could read the EJBHomeFactory pattern (you can find it in Floyd Marinescu's EJB Desing Patterns) and after that you'll see the benefits of caching the EJBHome objects.
I'm not really sure you posted this on the right forum. You should try the JSP forum instead.
Good luck.
You should post this on the BEA/Weblogic forum.
You can find useful info about Weblogic and other app servers here.
We cannot help unless you tell us what application server you are using. For example if you use JBoss the attribute-field mapping data can be found inside jbosscmp-jdbc.xml.
Tell us the app server you are using.
I'm using JBoss and in my test classes I initialize the Context like this:
java.util.Hashtable JNDIParm = new java.util.Hashtable();
JNDIParm.put(Context.PROVIDER_URL, "localhost");
return new InitialContext(JNDIParm);
Also, if you want to make any Remote interface available you have to add it here also...